@@ -97,7 +97,7 @@ func (controller *AdminController) AddAdminToOrg(ctx shared.Context) error {
9797 return echo .NewHTTPError (400 , "missing or invalid user id" )
9898 }
9999
100- user := ctx .Param ("user " )
100+ user := ctx .Param ("userID " )
101101
102102 if ! utils .IsEmail (user ) {
103103 return echo .NewHTTPError (400 , "user is not a valid mail address" )
@@ -116,15 +116,15 @@ func (controller *AdminController) AddAdminToOrg(ctx shared.Context) error {
116116 case dtos .CouldNotFindDefinitiveUserWithMail :
117117 return echo .NewHTTPError (400 , "could not find a definitive user associated with this email" )
118118 default :
119- return echo .NewHTTPError (500 , "could not determine user based on email" )
119+ return echo .NewHTTPError (500 , "could not determine user based on email" ). WithInternal ( err )
120120 }
121121 }
122122
123123 err = controller .adminService .AddAdminToOrg (context .Background (), parsedOrgID , userID )
124124 if err != nil {
125- return echo .NewHTTPError (500 , "could not add admin to organization" )
125+ return echo .NewHTTPError (500 , "could not add admin to organization" ). WithInternal ( err )
126126 }
127- return ctx .JSON (200 , nil )
127+ return ctx .JSON (201 , nil )
128128}
129129
130130func (controller * AdminController ) RevokeAdmin (ctx shared.Context ) error {
@@ -134,7 +134,7 @@ func (controller *AdminController) RevokeAdmin(ctx shared.Context) error {
134134 return echo .NewHTTPError (400 , "missing or invalid user id" )
135135 }
136136
137- user := ctx .Param ("user " )
137+ user := ctx .Param ("userID " )
138138
139139 if ! utils .IsEmail (user ) {
140140 return echo .NewHTTPError (400 , "user is not a valid mail address" )
@@ -160,7 +160,7 @@ func (controller *AdminController) RevokeAdmin(ctx shared.Context) error {
160160 if err != nil {
161161 return echo .NewHTTPError (500 , "could not revoke admin role from user" )
162162 }
163- return ctx .JSON (200 , nil )
163+ return ctx .JSON (204 , nil )
164164}
165165
166166// checkCooldown reads the config DB for the last trigger time and returns an
0 commit comments