not a fan of js/ts

This commit is contained in:
ThatOneCalculator 2022-08-09 01:13:08 -07:00
parent 6aaf8cbd7d
commit 82813ffe7b

View file

@ -59,14 +59,14 @@ 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(', ')})`;
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 (ARRAY[${m.recommendedInstances}])`;
const cursed = `(note.userHost = ANY (ARRAY${m.recommendedInstances.toString().split(',')})`;
console.log(cursed);
//#region Construct query
const query = makePaginationQuery(Notes.createQueryBuilder('note'),