Test for getWeeklyReport

This commit is contained in:
al8763be 2024-03-17 22:57:19 +01:00
parent c3ce25236f
commit 9f20d46fa6
2 changed files with 16 additions and 0 deletions

View file

@ -37,13 +37,19 @@ func (gs *GState) SubmitWeeklyReport(c *fiber.Ctx) error {
// Handler for retrieving weekly report
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")
println(projectName)
week := c.Query("week")
println(week)
// Convert week to integer
weekInt, err := strconv.Atoi(week)