Fixing report signing database interface
This commit is contained in:
parent
abfb79b991
commit
68e6f94d13
1 changed files with 6 additions and 1 deletions
|
@ -350,9 +350,14 @@ func (d *Db) SignWeeklyReport(reportId int, projectManagerId int) error {
|
|||
return err
|
||||
}
|
||||
|
||||
managerQuery := `SELECT project_id FROM user_roles
|
||||
WHERE user_id = ?
|
||||
AND project_id = (SELECT project_id FROM weekly_reports WHERE report_id = ?)
|
||||
AND p_role = 'project_manager'`
|
||||
|
||||
// Retrieve the project ID associated with the project manager
|
||||
var managerProjectID int
|
||||
err = d.Get(&managerProjectID, "SELECT project_id FROM user_roles WHERE user_id = ? AND p_role = 'project_manager'", projectManagerId)
|
||||
err = d.Get(&managerProjectID, managerQuery, projectManagerId, reportId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue