refact: change response struct get data

This commit is contained in:
pahmiudahgede 2024-12-15 02:49:49 +07:00
parent d362edad65
commit 40d4d10461
2 changed files with 2 additions and 10 deletions

View File

@ -34,11 +34,7 @@ func GetBanners(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(utils.FormatResponse( return c.Status(fiber.StatusOK).JSON(utils.FormatResponse(
fiber.StatusOK, fiber.StatusOK,
"Banners fetched successfully", "Banners fetched successfully",
struct { bannerResponses,
Banners []dto.BannerResponse `json:"banners"`
}{
Banners: bannerResponses,
},
)) ))
} }

View File

@ -39,11 +39,7 @@ func GetUserInitialCoint(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(utils.FormatResponse( return c.Status(fiber.StatusOK).JSON(utils.FormatResponse(
fiber.StatusOK, fiber.StatusOK,
"Points fetched successfully", "Points fetched successfully",
struct { pointResponses,
Points []dto.PointResponse `json:"points"`
}{
Points: pointResponses,
},
)) ))
} }