|
|
|
@ -114,7 +114,7 @@ export default class User implements UserType {
|
|
|
|
|
await ncMeta.metaUpdate(null, null, MetaTable.USERS, updateObj, id); |
|
|
|
|
|
|
|
|
|
// clear all user related cache
|
|
|
|
|
await this.clearCache(id); |
|
|
|
|
await this.clearCache(id, ncMeta); |
|
|
|
|
|
|
|
|
|
return this.get(id, ncMeta); |
|
|
|
|
} |
|
|
|
@ -232,7 +232,7 @@ export default class User implements UserType {
|
|
|
|
|
if (!user) NcError.badRequest('User not found'); |
|
|
|
|
|
|
|
|
|
// clear all user related cache
|
|
|
|
|
await this.clearCache(userId); |
|
|
|
|
await this.clearCache(userId, ncMeta); |
|
|
|
|
|
|
|
|
|
return await ncMeta.metaDelete(null, null, MetaTable.USERS, userId); |
|
|
|
|
} |
|
|
|
@ -273,11 +273,11 @@ export default class User implements UserType {
|
|
|
|
|
} as any; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static async clearCache(userId: string) { |
|
|
|
|
const user = await this.get(userId); |
|
|
|
|
protected static async clearCache(userId: string, ncMeta = Noco.ncMeta) { |
|
|
|
|
const user = await this.get(userId, ncMeta); |
|
|
|
|
if (!user) NcError.badRequest('User not found'); |
|
|
|
|
|
|
|
|
|
const bases = await BaseUser.getProjectsList(userId, {}); |
|
|
|
|
const bases = await BaseUser.getProjectsList(userId, {}, ncMeta); |
|
|
|
|
|
|
|
|
|
for (const base of bases) { |
|
|
|
|
await NocoCache.deepDel( |
|
|
|
|