fix for pinned users. update changelog (#9159)

This commit is contained in:
squidicuz
2022-11-10 21:22:31 -05:00
committed by GitHub
parent 24d18a7b19
commit 2492f4e81e
2 changed files with 3 additions and 2 deletions

View File

@ -43,12 +43,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
super(meta, paramDef, async (ps, me) => {
const meta = await this.metaService.fetch();
const users = await Promise.all(meta.pinnedthis.usersRepository.map(acct => Acct.parse(acct)).map(acct => this.usersRepository.findOneBy({
const users = await Promise.all(meta.pinnedUsers.map(acct => Acct.parse(acct)).map(acct => this.usersRepository.findOneBy({
usernameLower: acct.username.toLowerCase(),
host: acct.host ?? IsNull(),
})));
return await this.userEntityService.packMany(users.filter(x => x !== undefined) as User[], me, { detail: true });
return await this.userEntityService.packMany(users.filter(x => x !== null) as User[], me, { detail: true });
});
}
}