Skip to content

Commit 14f9f0f

Browse files
committed
fix: fix lint
1 parent 5583b78 commit 14f9f0f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

coderd/database/databasefake/databasefake.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ func (q *fakeQuerier) GetOrganizationMemberByUserID(_ context.Context, arg datab
709709
return database.OrganizationMember{}, sql.ErrNoRows
710710
}
711711

712-
func (q *fakeQuerier) GetOrganizationIDsByMemberIDs(c context.Context, ids []uuid.UUID) ([]database.GetOrganizationIDsByMemberIDsRow, error) {
712+
func (q *fakeQuerier) GetOrganizationIDsByMemberIDs(_ context.Context, ids []uuid.UUID) ([]database.GetOrganizationIDsByMemberIDsRow, error) {
713713
q.mutex.RLock()
714714
defer q.mutex.RUnlock()
715715

coderd/users.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (api *api) postUser(rw http.ResponseWriter, r *http.Request) {
235235
// is completed in the middleware for this route.
236236
func (api *api) userByName(rw http.ResponseWriter, r *http.Request) {
237237
user := httpmw.UserParam(r)
238-
organizationIDs, err := userOrganizationIDs(api, rw, r, user)
238+
organizationIDs, err := userOrganizationIDs(r.Context(), api, user)
239239

240240
if err != nil {
241241
httpapi.Write(rw, http.StatusInternalServerError, httpapi.Response{
@@ -301,7 +301,7 @@ func (api *api) putUserProfile(rw http.ResponseWriter, r *http.Request) {
301301
return
302302
}
303303

304-
organizationIDs, err := userOrganizationIDs(api, rw, r, user)
304+
organizationIDs, err := userOrganizationIDs(r.Context(), api, user)
305305
if err != nil {
306306
httpapi.Write(rw, http.StatusInternalServerError, httpapi.Response{
307307
Message: fmt.Sprintf("get organization IDs: %s", err.Error()),
@@ -328,7 +328,7 @@ func (api *api) putUserSuspend(rw http.ResponseWriter, r *http.Request) {
328328
return
329329
}
330330

331-
organizations, err := userOrganizationIDs(api, rw, r, user)
331+
organizations, err := userOrganizationIDs(r.Context(), api, user)
332332
if err != nil {
333333
httpapi.Write(rw, http.StatusInternalServerError, httpapi.Response{
334334
Message: fmt.Sprintf("get organization IDs: %s", err.Error()),
@@ -685,8 +685,8 @@ func convertUsers(users []database.User, organizationIDsByUserID map[uuid.UUID][
685685
return converted
686686
}
687687

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})
690690
if errors.Is(err, sql.ErrNoRows) || len(organizationIDsByMemberIDsRows) == 0 {
691691
return []uuid.UUID{}, nil
692692
}

0 commit comments

Comments
 (0)