Merge branch 'dev' into gruppDM

This commit is contained in:
Davenludd 2024-04-13 16:28:18 +02:00
commit 9ec7261a94
3 changed files with 8 additions and 4 deletions

View file

@ -400,7 +400,7 @@ func (d *Db) UnsignWeeklyReport(reportId int, projectManagerId int) error {
}
// Update the signed_by field of the specified report
_, err = d.Exec("UPDATE weekly_reports SET signed_by = NULL WHERE report_id = ?;", projectManagerId, reportId)
_, err = d.Exec("UPDATE weekly_reports SET signed_by = NULL WHERE report_id = ?;", reportId)
return err
}

View file

@ -36,6 +36,6 @@ func UnsignReport(c *fiber.Ctx) error {
return c.Status(500).SendString(err.Error())
}
log.Info("Project manager ID: ", projectManagerID, " signed report ID: ", reportId)
log.Info("Project manager ID: ", projectManagerID, " unsigned report ID: ", reportId)
return c.Status(200).SendString("Weekly report unsigned successfully")
}

View file

@ -264,7 +264,9 @@ def test_unsign_report():
dprint("Sign report successful")
# Retrieve the report ID again for confirmation
report_id = getReport(member_token, member_user, project_name)["reportId"]
report = getReport(member_token, member_user, project_name)
dprint(report)
report_id = report["reportId"]
assert report_id != None, "Get report failed"
# Unsign the report as the project manager
@ -273,8 +275,10 @@ def test_unsign_report():
dprint("Unsign report successful")
# Retrieve the report ID again for confirmation
report_id = getReport(member_token, member_user, project_name)["reportId"]
report = getReport(member_token, member_user, project_name)
assert report_id != None, "Get report failed"
dprint(report)
assert report["signedBy"] == None, "Report was not unsigned"
gprint("test_unsign_report successful")