added operations
Build and Test / build-and-test-backend (push) Successful in 1m2s
Build and Test / build-and-test-frontend (push) Successful in 34s

This commit is contained in:
wt committed 2025-09-02 18:25:06 +07:00
1 parent 59f5a2cbc6
commit e16edd7744
6 files changed
+130 -11

No files matched your search

+6 -2
View File
@@ -1,13 +1,17 @@
package api
import (
"backend/internal/operation"
"backend/database"
"github.com/gofiber/fiber/v2"
"github.com/golang-jwt/jwt/v5"
)
func GetAllOperation(c *fiber.Ctx) error {
operations, err := operation.GetAllOperation()
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(),