mirror of
https://github.com/syuilo/ai.git
synced 2024-11-09 23:48:01 +00:00
fix user info update logic
This commit is contained in:
parent
e8b2ff4d62
commit
e6706df8f9
|
@ -59,7 +59,8 @@ export default class Friend {
|
||||||
this.doc = inserted;
|
this.doc = inserted;
|
||||||
} else {
|
} else {
|
||||||
this.doc = exist;
|
this.doc = exist;
|
||||||
this.doc.user = opts.user;
|
this.doc.user = { ...this.doc.user, ...opts.user };
|
||||||
|
console.log(this.doc.user);
|
||||||
this.save();
|
this.save();
|
||||||
}
|
}
|
||||||
} else if (opts.doc) {
|
} else if (opts.doc) {
|
||||||
|
@ -70,8 +71,11 @@ export default class Friend {
|
||||||
}
|
}
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
public updateUser(user: User) {
|
public updateUser(user: Partial<User>) {
|
||||||
this.doc.user = user;
|
this.doc.user = {
|
||||||
|
...this.doc.user,
|
||||||
|
...user,
|
||||||
|
};
|
||||||
this.save();
|
this.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue