mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-12-04 15:47:55 -07:00
94228778c9
* wip * wip * fix * clean up * Update tsconfig.json * Update activitypub.ts * wip
13 lines
488 B
TypeScript
13 lines
488 B
TypeScript
import { User } from '@/models/entities/user.js';
|
|
import { MutedNotes } from '@/models/index.js';
|
|
import { SelectQueryBuilder } from 'typeorm';
|
|
|
|
export function generateMutedNoteQuery(q: SelectQueryBuilder<any>, me: { id: User['id'] }) {
|
|
const mutedQuery = MutedNotes.createQueryBuilder('muted')
|
|
.select('muted.noteId')
|
|
.where('muted.userId = :userId', { userId: me.id });
|
|
|
|
q.andWhere(`note.id NOT IN (${ mutedQuery.getQuery() })`);
|
|
|
|
q.setParameters(mutedQuery.getParameters());
|
|
}
|