// Path: Backend/internal/http/respond/respond.go

package respond

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

type ErrorBody struct {
	Error   string `json:"error"`
	Message string `json:"message"`
}

func Error(c *fiber.Ctx, status int, code string, message string) error {
	return c.Status(status).JSON(ErrorBody{Error: code, Message: message})
}

func DatabaseError(c *fiber.Ctx, err error) error {
	return Error(c, fiber.StatusInternalServerError, "database_error", err.Error())
}
