From c6d93079790e0ca3e9945883d2223b20491686ea Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 16 Mar 2024 22:57:48 +0100 Subject: [PATCH] Fix for CreateProject handler --- backend/internal/handlers/global_state.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/handlers/global_state.go b/backend/internal/handlers/global_state.go index f8c7ce1..f7172f5 100644 --- a/backend/internal/handlers/global_state.go +++ b/backend/internal/handlers/global_state.go @@ -165,9 +165,9 @@ func (gs *GState) CreateProject(c *fiber.Ctx) error { // Get the username from the token and set it as the owner of the project // This is ugly but claims := user.Claims.(jwt.MapClaims) - p.Owner = claims["name"].(string) + owner := claims["name"].(string) - if err := gs.Db.AddProject(p.Name, p.Description, p.Owner); err != nil { + if err := gs.Db.AddProject(p.Name, p.Description, owner); err != nil { return c.Status(500).SendString(err.Error()) }