Implement profile-update api
This commit is contained in:
parent
bf39791f01
commit
0aaa406b17
4 changed files with 39 additions and 15 deletions
|
@ -88,11 +88,11 @@ export class ProfileViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
async updateProfile(profile: Profile.Record) {
|
||||
async updateProfile(fn: (existing?: Profile.Record) => Profile.Record) {
|
||||
if (this.did !== this.rootStore.me.did) {
|
||||
throw new Error('Not your profile!')
|
||||
}
|
||||
await apilib.updateProfile(this.rootStore.api, this.did, profile)
|
||||
await apilib.updateProfile(this.rootStore, fn)
|
||||
await this.refresh()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue