This commit is contained in:
tamaina
2023-01-22 16:07:17 +00:00
parent 226e0c4714
commit d347f0a087
5 changed files with 18 additions and 15 deletions

View File

@ -22,8 +22,10 @@ export class EmojiEntityService {
@bindThis
public async pack(
src: Emoji['id'] | Emoji,
opts: { omitHost?: boolean; omitId?: boolean; withUrl?: boolean; } = {},
opts: { omitHost?: boolean; omitId?: boolean; withUrl?: boolean; } = { omitHost: true, omitId: true, withUrl: true },
): Promise<Packed<'Emoji'>> {
opts = { omitHost: true, omitId: true, withUrl: true, ...opts }
const emoji = typeof src === 'object' ? src : await this.emojisRepository.findOneByOrFail({ id: src });
return {

View File

@ -101,7 +101,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
.take(ps.limit)
.getMany();
return this.emojiEntityService.packMany(emojis);
return this.emojiEntityService.packMany(emojis, { omitHost: false, omitId: false, withUrl: false });
});
}
}

View File

@ -98,7 +98,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
emojis = await q.take(ps.limit).getMany();
}
return this.emojiEntityService.packMany(emojis);
return this.emojiEntityService.packMany(emojis, { omitHost: false, omitId: false, withUrl: false });
});
}
}