2024-04-09 15:52:37 +00:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import "github.com/gofiber/fiber/v2"
|
|
|
|
|
|
|
|
func (c *Controller) GettingFieldsFromCash(ctx *fiber.Ctx) error {
|
|
|
|
req, err := extractParams(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-04-18 11:13:03 +00:00
|
|
|
response, err := c.service.GetFieldsWithPagination(ctx.Context(), req)
|
2024-04-09 15:52:37 +00:00
|
|
|
if err != nil {
|
|
|
|
return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
|
|
|
|
}
|
|
|
|
return ctx.Status(fiber.StatusOK).JSON(response)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Controller) UpdateListCustom(ctx *fiber.Ctx) error {
|
|
|
|
err := c.service.UpdateListCustom(ctx.Context())
|
|
|
|
if err != nil {
|
|
|
|
return ctx.Status(fiber.StatusInternalServerError).SendString("Internal Server Error")
|
|
|
|
}
|
|
|
|
return ctx.SendStatus(fiber.StatusOK)
|
|
|
|
}
|