refactor(ApPersonService.ts): type guardによるnon-null assertionの削除

This commit is contained in:
okayurisotto 2023-07-02 19:11:00 +09:00
parent a40ea8163e
commit d276dabf26

View File

@ -623,13 +623,13 @@ export class ApPersonService implements OnModuleInit {
// とりあえずidを別の時間で生成して順番を維持
let td = 0;
for (const note of featuredNotes.filter(note => note != null)) {
for (const note of featuredNotes.filter((note): note is Note => note != null)) {
td -= 1000;
transactionalEntityManager.insert(UserNotePining, {
id: this.idService.genId(new Date(Date.now() + td)),
createdAt: new Date(),
userId: user.id,
noteId: note!.id,
noteId: note.id,
});
}
});