@@ -235,7 +235,7 @@ func (api *api) postUser(rw http.ResponseWriter, r *http.Request) {
235
235
// is completed in the middleware for this route.
236
236
func (api * api ) userByName (rw http.ResponseWriter , r * http.Request ) {
237
237
user := httpmw .UserParam (r )
238
- organizationIDs , err := userOrganizationIDs (api , rw , r , user )
238
+ organizationIDs , err := userOrganizationIDs (r . Context (), api , user )
239
239
240
240
if err != nil {
241
241
httpapi .Write (rw , http .StatusInternalServerError , httpapi.Response {
@@ -301,7 +301,7 @@ func (api *api) putUserProfile(rw http.ResponseWriter, r *http.Request) {
301
301
return
302
302
}
303
303
304
- organizationIDs , err := userOrganizationIDs (api , rw , r , user )
304
+ organizationIDs , err := userOrganizationIDs (r . Context (), api , user )
305
305
if err != nil {
306
306
httpapi .Write (rw , http .StatusInternalServerError , httpapi.Response {
307
307
Message : fmt .Sprintf ("get organization IDs: %s" , err .Error ()),
@@ -328,7 +328,7 @@ func (api *api) putUserSuspend(rw http.ResponseWriter, r *http.Request) {
328
328
return
329
329
}
330
330
331
- organizations , err := userOrganizationIDs (api , rw , r , user )
331
+ organizations , err := userOrganizationIDs (r . Context (), api , user )
332
332
if err != nil {
333
333
httpapi .Write (rw , http .StatusInternalServerError , httpapi.Response {
334
334
Message : fmt .Sprintf ("get organization IDs: %s" , err .Error ()),
@@ -685,8 +685,8 @@ func convertUsers(users []database.User, organizationIDsByUserID map[uuid.UUID][
685
685
return converted
686
686
}
687
687
688
- func userOrganizationIDs (api * api , rw http. ResponseWriter , r * http. Request , user database.User ) ([]uuid.UUID , error ) {
689
- organizationIDsByMemberIDsRows , err := api .Database .GetOrganizationIDsByMemberIDs (r . Context () , []uuid.UUID {user .ID })
688
+ func userOrganizationIDs (ctx context. Context , api * api , user database.User ) ([]uuid.UUID , error ) {
689
+ organizationIDsByMemberIDsRows , err := api .Database .GetOrganizationIDsByMemberIDs (ctx , []uuid.UUID {user .ID })
690
690
if errors .Is (err , sql .ErrNoRows ) || len (organizationIDsByMemberIDsRows ) == 0 {
691
691
return []uuid.UUID {}, nil
692
692
}
0 commit comments