Find is done
This commit is contained in:
@@ -61,10 +61,10 @@ func (h *OrdersHandler) ListOrders(c fiber.Ctx) error {
|
||||
}
|
||||
|
||||
var columnMappingListOrders map[string]string = map[string]string{
|
||||
"order_id": "co.id",
|
||||
"user_id": "co.user_id",
|
||||
"country_id": "co.country_id",
|
||||
"status": "co.status",
|
||||
"order_id": "b2b_customer_orders.id",
|
||||
"user_id": "b2b_customer_orders.user_id",
|
||||
"country_id": "b2b_customer_orders.country_id",
|
||||
"status": "b2b_customer_orders.status",
|
||||
}
|
||||
|
||||
func (h *OrdersHandler) PlaceNewOrder(c fiber.Ctx) error {
|
||||
@@ -81,7 +81,6 @@ func (h *OrdersHandler) PlaceNewOrder(c fiber.Ctx) error {
|
||||
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
|
||||
}
|
||||
|
||||
address_info := c.Query("address_info")
|
||||
country_id_attribute := c.Query("country_id")
|
||||
country_id, err := strconv.Atoi(country_id_attribute)
|
||||
if err != nil {
|
||||
@@ -89,6 +88,8 @@ func (h *OrdersHandler) PlaceNewOrder(c fiber.Ctx) error {
|
||||
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
|
||||
}
|
||||
|
||||
address_info := c.Query("address_info")
|
||||
|
||||
err = h.ordersService.PlaceNewOrder(userID, uint(cart_id), uint(country_id), address_info)
|
||||
if err != nil {
|
||||
return c.Status(responseErrors.GetErrorStatus(err)).
|
||||
|
||||
Reference in New Issue
Block a user