CB-4096 fix: synchronize user info data update (#2096)

Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
This commit is contained in:
Alexey
2023-10-27 20:11:39 +03:00
committed by GitHub
co-authored by EvgeniaBzzz
parent 5255ee96db
commit 584dd1ce4f
@@ -182,7 +182,15 @@ export class UsersResource extends CachedMapResource<string, AdminUser, UserReso
}
async setAuthRole(userId: string, authRole?: string, skipUpdate?: boolean): Promise<void> {
await this.graphQLService.sdk.setUserAuthRole({ userId, authRole });
await this.performUpdate(userId, undefined, async () => {
await this.graphQLService.sdk.setUserAuthRole({ userId, authRole });
const user = this.get(userId);
if (user) {
user.authRole = authRole;
}
});
if (!skipUpdate) {
this.markOutdated(userId);