Feat: update user profile (#491)

* add update profile api

* may update email

* may update username
This commit is contained in:
an-lee
2024-04-07 14:38:43 +08:00
committed by GitHub
parent 52287357d5
commit aa334dfb09
7 changed files with 263 additions and 50 deletions

View File

@@ -82,6 +82,17 @@ export class Client {
return this.api.get("/api/me");
}
updateProfile(
id: string,
params: {
name?: string;
email?: string;
code?: string;
}
): Promise<UserType> {
return this.api.put(`/api/users/${id}`, decamelizeKeys(params));
}
loginCode(params: { phoneNumber?: string; email?: string }): Promise<void> {
return this.api.post("/api/sessions/login_code", decamelizeKeys(params));
}