mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-25 20:18:05 +09:00
55e188ae23
* wip * wip * wip * wip * wip * wip * wip * wip * wip
14 lines
476 B
TypeScript
14 lines
476 B
TypeScript
import { User } from '../../../models/entities/user';
|
|
import { MutedNotes } from '../../../models';
|
|
import { SelectQueryBuilder } from 'typeorm';
|
|
|
|
export function generateMutedNoteQuery(q: SelectQueryBuilder<any>, me: User) {
|
|
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());
|
|
}
|