Linter fixes and proper error handling in PromoteToPm

This commit is contained in:
Imbus 2024-04-04 23:02:10 +02:00
parent 7635791f09
commit 1f4abc2a6a
3 changed files with 6 additions and 2 deletions

View file

@ -44,6 +44,10 @@ func PromoteToPm(c *fiber.Ctx) error {
// Add the user to the project with the specified role
err = db.GetDb(c).ChangeUserRole(new_pm_name, project, "project_manager")
if err != nil {
log.Info("Error promoting user to project manager:", err)
return c.Status(500).SendString(err.Error())
}
// Return success message
log.Info("User : ", new_pm_name, " promoted to project manager in project: ", project)