package api import ( "backend/database" "github.com/gofiber/fiber/v2" "github.com/golang-jwt/jwt/v5" ) func GetAllOperation(c *fiber.Ctx) error { user := c.Locals("user").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) userid := claims["id"].(string) operations, err := database.GetAllOperations(userid) if err != nil { return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{ "error": err.Error(), }) } return c.JSON(operations) }