mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-24 23:26:07 +09:00
Clean up
This commit is contained in:
parent
199d92e742
commit
9ad8f10fa5
@ -59,18 +59,16 @@ export const paramDef = {
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const m = await fetchMeta();
|
||||
// const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`;
|
||||
if (m.disableRecommendedTimeline) {
|
||||
if (user == null || (!user.isAdmin && !user.isModerator)) {
|
||||
throw new ApiError(meta.errors.rtlDisabled);
|
||||
}
|
||||
}
|
||||
|
||||
const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`;
|
||||
//#region Construct query
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere(cursed)
|
||||
.andWhere(`(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`)
|
||||
.andWhere('(note.visibility = \'public\')')
|
||||
.innerJoinAndSelect('note.user', 'user')
|
||||
.leftJoinAndSelect('user.avatar', 'avatar')
|
||||
|
Loading…
Reference in New Issue
Block a user