Merge branch 'dev' into gruppDM
This commit is contained in:
commit
9ec7261a94
3 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue