diff options
Diffstat (limited to 'Timeline/ClientApp/src/app/data/user.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/data/user.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/data/user.ts b/Timeline/ClientApp/src/app/data/user.ts index ceabdbe2..f42b2d58 100644 --- a/Timeline/ClientApp/src/app/data/user.ts +++ b/Timeline/ClientApp/src/app/data/user.ts @@ -363,6 +363,15 @@ export class UserInfoService { await getHttpUserClient().putAvatar(username, blob, user.token); this._avatarHub.getLine(username)?.next({ data: blob, type: "synced" }); } + + async setNickname(username: string, nickname: string): Promise<void> { + const user = checkLogin(); + return getHttpUserClient() + .patch(username, { nickname }, user.token) + .then((user) => { + void this.saveUser(user); + }); + } } export const userInfoService = new UserInfoService(); |