package controller

import (
	service "gitlab.com/mbugroup/lti-api.git/internal/modules/constants/services"

	"github.com/gofiber/fiber/v2"
)

type ConstantController struct {
	ConstantService service.ConstantService
}

func NewConstantController(constantService service.ConstantService) *ConstantController {
	return &ConstantController{
		ConstantService: constantService,
	}
}

func (ctrl *ConstantController) GetAll(c *fiber.Ctx) error {
	data, err := ctrl.ConstantService.GetAll(c)
	if err != nil {
		return fiber.NewError(fiber.StatusInternalServerError, err.Error())
	}
	return c.Status(fiber.StatusOK).JSON(data)
}
