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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -19,6 +19,7 @@ You should also include the user name that made the change.
### Improvements ### Improvements
### Bugfixes ### Bugfixes
- Server: Bug fix for Pinned Users lookup on instance @squidicuzz
## 12.119.0 (2022/09/10) ## 12.119.0 (2022/09/10)

View file

@ -43,12 +43,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const meta = await this.metaService.fetch(); 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(), usernameLower: acct.username.toLowerCase(),
host: acct.host ?? IsNull(), 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 });
}); });
} }
} }