Fixing getWeeklyReport tests

This commit is contained in:
Imbus 2024-03-17 23:17:06 +01:00
parent 9f20d46fa6
commit 9070846b0b
3 changed files with 3 additions and 5 deletions

View file

@ -39,11 +39,8 @@ func (gs *GState) GetWeeklyReport(c *fiber.Ctx) error {
// Extract the necessary parameters from the request
println("GetWeeklyReport")
user := c.Locals("user").(*jwt.Token)
println(user)
claims := user.Claims.(jwt.MapClaims)
println(claims)
username := claims["name"].(string)
println(username)
// Extract project name and week from query parameters
projectName := c.Query("projectName")

View file

@ -78,6 +78,7 @@ func main() {
server.Post("/api/loginrenew", gs.LoginRenew)
server.Delete("/api/userdelete/:username", gs.UserDelete) // Perhaps just use POST to avoid headaches
server.Post("/api/project", gs.CreateProject)
server.Get("/api/getWeeklyReport", gs.GetWeeklyReport)
// Announce the port we are listening on and start the server
err = server.Listen(fmt.Sprintf(":%d", conf.Port))