Update SystemAccountService.ts
This commit is contained in:
parent
f8396fc384
commit
380e078210
|
@ -150,12 +150,16 @@ export class SystemAccountService {
|
||||||
const updates = {} as Partial<MiUser>;
|
const updates = {} as Partial<MiUser>;
|
||||||
if (extra.name !== undefined) updates.name = extra.name;
|
if (extra.name !== undefined) updates.name = extra.name;
|
||||||
|
|
||||||
|
if (Object.keys(updates).length > 0) {
|
||||||
await this.usersRepository.update(user.id, updates);
|
await this.usersRepository.update(user.id, updates);
|
||||||
|
}
|
||||||
|
|
||||||
const profileUpdates = {} as Partial<MiUserProfile>;
|
const profileUpdates = {} as Partial<MiUserProfile>;
|
||||||
if (extra.description !== undefined) profileUpdates.description = extra.description;
|
if (extra.description !== undefined) profileUpdates.description = extra.description;
|
||||||
|
|
||||||
|
if (Object.keys(profileUpdates).length > 0) {
|
||||||
await this.userProfilesRepository.update(user.id, profileUpdates);
|
await this.userProfilesRepository.update(user.id, profileUpdates);
|
||||||
|
}
|
||||||
|
|
||||||
const updated = await this.usersRepository.findOneByOrFail({ id: user.id }) as MiLocalUser;
|
const updated = await this.usersRepository.findOneByOrFail({ id: user.id }) as MiLocalUser;
|
||||||
this.cache.set(type, updated);
|
this.cache.set(type, updated);
|
||||||
|
|
Loading…
Reference in New Issue