Skip to content
This repository was archived by the owner on Feb 4, 2021. It is now read-only.

Commit 31233db

Browse files
committed
Fix
1 parent 8383b91 commit 31233db

File tree

5 files changed

+27
-22
lines changed

5 files changed

+27
-22
lines changed

api/protos/users.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ service UserService {
4141
}
4242
rpc UpdateUserIcon (UpdateUserIconRequest) returns (User) {
4343
option (google.api.http) = {
44-
patch: "/user/icon"
44+
post: "/user/icon"
4545
body: "*"
4646
};
4747
}

api/users.pb.go

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/users.pb.gw.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/users.swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333
},
3434
"/user/icon": {
35-
"patch": {
35+
"post": {
3636
"operationId": "UpdateUserIcon",
3737
"responses": {
3838
"200": {

infra/store/user/user_store.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ func (s *userStoreImpl) UpdateIcon(userID model.UserID, icon []byte) (*record.Us
128128
return nil, errors.WithStack(err)
129129
}
130130

131-
u, err := record.FindUser(s.ctx, s.db, int64(userID))
131+
mods := []qm.QueryMod{
132+
qm.Load("Profile.Role"),
133+
qm.Load("Profile.Department"),
134+
qm.Where("id = ?", userID),
135+
}
136+
u, err := record.Users(mods...).One(s.ctx, s.db)
132137
if err != nil {
133138
return nil, errors.WithStack(err)
134139
}

0 commit comments

Comments
 (0)