refactor: constrain type

This commit is contained in:
Namekuji 2023-09-05 18:34:58 -04:00
parent 6063f4d7ab
commit 065b889ccb
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532

View file

@ -132,11 +132,11 @@ export default define(meta, paramDef, async (ps, user) => {
blockerIds.includes(n.notifierId)) blockerIds.includes(n.notifierId))
), ),
); );
if ( if (ps.directOnly) {
ps.directOnly && filtered = filtered.filter(
ps.includeTypes?.every((t) => ["mention", "reply"].includes(t)) ({ entityId, type }) =>
) { entityId && ["mention", "reply"].includes(type),
filtered = filtered.filter(({ entityId }) => !!entityId); );
let notes = await client let notes = await client
.execute( .execute(
prepared.note.select.byIds, prepared.note.select.byIds,