mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 14:55:42 +00:00
add restrict create/edit/delete depletion
This commit is contained in:
@@ -103,3 +103,22 @@ func (u *AdjustmentController) GetOne(c *fiber.Ctx) error {
|
||||
Data: dto.ToAdjustmentDetailDTO(stockLog),
|
||||
})
|
||||
}
|
||||
|
||||
func (u *AdjustmentController) 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.AdjustmentService.DeleteOne(c, uint(id)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.Status(fiber.StatusOK).
|
||||
JSON(response.Common{
|
||||
Code: fiber.StatusOK,
|
||||
Status: "success",
|
||||
Message: "Delete adjustment successfully",
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user