fix misnamed field on sub resolver
This commit is contained in:
parent
1d4ba7b9a6
commit
657ce1a4f8
|
@ -95,8 +95,9 @@ export default {
|
||||||
if (me) {
|
if (me) {
|
||||||
const currentUser = await models.user.findUnique({ where: { id: me.id } })
|
const currentUser = await models.user.findUnique({ where: { id: me.id } })
|
||||||
const showNsfw = currentUser ? currentUser.nsfwMode : false
|
const showNsfw = currentUser ? currentUser.nsfwMode : false
|
||||||
|
|
||||||
return await models.$queryRawUnsafe(`
|
return await models.$queryRawUnsafe(`
|
||||||
SELECT "Sub".*, COALESCE(json_agg("MuteSub".*) FILTER (WHERE "MuteSub"."userId" IS NOT NULL), '[]') AS "MuteSub"
|
SELECT "Sub".*, "Sub".created_at as "createdAt", COALESCE(json_agg("MuteSub".*) FILTER (WHERE "MuteSub"."userId" IS NOT NULL), '[]') AS "MuteSub"
|
||||||
FROM "Sub"
|
FROM "Sub"
|
||||||
LEFT JOIN "MuteSub" ON "Sub".name = "MuteSub"."subName" AND "MuteSub"."userId" = ${me.id}::INTEGER
|
LEFT JOIN "MuteSub" ON "Sub".name = "MuteSub"."subName" AND "MuteSub"."userId" = ${me.id}::INTEGER
|
||||||
WHERE status <> 'STOPPED' ${showNsfw ? '' : 'AND "Sub"."nsfw" = FALSE'}
|
WHERE status <> 'STOPPED' ${showNsfw ? '' : 'AND "Sub"."nsfw" = FALSE'}
|
||||||
|
|
Loading…
Reference in New Issue