adjust response api get all closing, response api get closing tab sapronak

This commit is contained in:
giovanni-ce
2025-12-09 16:23:05 +07:00
parent 536e76d481
commit 4a2a80916f
6 changed files with 98 additions and 66 deletions
@@ -40,7 +40,7 @@ func (u *ClosingController) GetAll(c *fiber.Ctx) error {
}
return c.Status(fiber.StatusOK).
JSON(response.SuccessWithPaginate[dto.ClosingSummaryDTO]{
JSON(response.SuccessWithPaginate[dto.ClosingListItemDTO]{
Code: fiber.StatusOK,
Status: "success",
Message: "Retrieved closing projects list successfully",
@@ -152,25 +152,17 @@ func (u *ClosingController) GetClosingSapronak(c *fiber.Ctx) error {
return err
}
resp := struct {
Code int `json:"code"`
Status string `json:"status"`
Message string `json:"message"`
Meta response.Meta `json:"meta"`
Data interface{} `json:"data"`
}{
Code: fiber.StatusOK,
Status: "success",
Message: "Retrieved closing report (sapronak) successfully",
Meta: response.Meta{
Page: query.Page,
Limit: query.Limit,
TotalPages: int64(math.Ceil(float64(totalResults) / float64(query.Limit))),
TotalResults: totalResults,
},
Data: result,
}
return c.Status(fiber.StatusOK).
JSON(resp)
JSON(response.SuccessWithPaginate[dto.ClosingSapronakItemDTO]{
Code: fiber.StatusOK,
Status: "success",
Message: "Retrieved closing report (sapronak) successfully",
Meta: response.Meta{
Page: query.Page,
Limit: query.Limit,
TotalPages: int64(math.Ceil(float64(totalResults) / float64(query.Limit))),
TotalResults: totalResults,
},
Data: result,
})
}