refactor: fix types
This commit is contained in:
parent
d7a2d59f41
commit
451bc0b444
24 changed files with 142 additions and 130 deletions
|
@ -45,10 +45,10 @@ export class UserCacheService implements OnApplicationShutdown {
|
|||
case 'userChangeSuspendedState':
|
||||
case 'remoteUserUpdated': {
|
||||
const user = await this.usersRepository.findOneByOrFail({ id: body.id });
|
||||
this.userByIdCache.set(user.id, user);
|
||||
this.userByIdCache.set(user.id, user as CacheableUser);
|
||||
for (const [k, v] of this.uriPersonCache.cache.entries()) {
|
||||
if (v.value?.id === user.id) {
|
||||
this.uriPersonCache.set(k, user);
|
||||
this.uriPersonCache.set(k, user as CacheableUser);
|
||||
}
|
||||
}
|
||||
if (this.userEntityService.isLocalUser(user)) {
|
||||
|
@ -78,7 +78,7 @@ export class UserCacheService implements OnApplicationShutdown {
|
|||
|
||||
@bindThis
|
||||
public findById(userId: User['id']) {
|
||||
return this.userByIdCache.fetch(userId, () => this.usersRepository.findOneByOrFail({ id: userId }));
|
||||
return this.userByIdCache.fetch(userId, () => this.usersRepository.findOneByOrFail({ id: userId }) as Promise<CacheableUser>);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue