mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 07:15:43 +00:00
Feat[BE-222]: Completed SO and DO API
This commit is contained in:
+1
-42
@@ -39,7 +39,7 @@ func (u *DeliveryOrdersController) GetAll(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
return c.Status(fiber.StatusOK).
|
||||
JSON(response.SuccessWithPaginate[dto.DeliveryOrdersListDTO]{
|
||||
JSON(response.SuccessWithPaginate[dto.MarketingListDTO]{
|
||||
Code: fiber.StatusOK,
|
||||
Status: "success",
|
||||
Message: "Get all deliveryOrderss successfully",
|
||||
@@ -122,44 +122,3 @@ func (u *DeliveryOrdersController) UpdateOne(c *fiber.Ctx) error {
|
||||
Data: result,
|
||||
})
|
||||
}
|
||||
|
||||
func (u *DeliveryOrdersController) DeleteOne(c *fiber.Ctx) error {
|
||||
param := c.Params("id")
|
||||
|
||||
id, err := strconv.Atoi(param)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "Invalid Id")
|
||||
}
|
||||
|
||||
if err := u.DeliveryOrdersService.DeleteOne(c, uint(id)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.Status(fiber.StatusOK).
|
||||
JSON(response.Common{
|
||||
Code: fiber.StatusOK,
|
||||
Status: "success",
|
||||
Message: "Delete deliveryOrders successfully",
|
||||
})
|
||||
}
|
||||
|
||||
func (u *DeliveryOrdersController) Approval(c *fiber.Ctx) error {
|
||||
req := new(validation.Approve)
|
||||
|
||||
if err := c.BodyParser(req); err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "Invalid request body")
|
||||
}
|
||||
|
||||
results, err := u.DeliveryOrdersService.Approval(c, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.Status(fiber.StatusOK).
|
||||
JSON(response.Success{
|
||||
Code: fiber.StatusOK,
|
||||
Status: "success",
|
||||
Message: "Submit delivery order approval successfully",
|
||||
Data: results,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user