mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 08:31:15 -05:00
Fix moderation queue query
This commit is contained in:
@@ -137,8 +137,9 @@ export function buildSubmissionQuery(
|
|||||||
// Admins see all submissions
|
// Admins see all submissions
|
||||||
if (!isAdmin && !isSuperuser) {
|
if (!isAdmin && !isSuperuser) {
|
||||||
const now = new Date().toISOString();
|
const now = new Date().toISOString();
|
||||||
|
// Fixed: Add null check for locked_until to prevent 400 error
|
||||||
query = query.or(
|
query = query.or(
|
||||||
`assigned_to.is.null,locked_until.lt.${now},assigned_to.eq.${userId}`
|
`assigned_to.is.null,and(locked_until.not.is.null,locked_until.lt.${now}),assigned_to.eq.${userId}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,8 +190,9 @@ export function buildCountQuery(
|
|||||||
|
|
||||||
if (!isAdmin && !isSuperuser) {
|
if (!isAdmin && !isSuperuser) {
|
||||||
const now = new Date().toISOString();
|
const now = new Date().toISOString();
|
||||||
|
// Fixed: Add null check for locked_until to prevent 400 error
|
||||||
countQuery = countQuery.or(
|
countQuery = countQuery.or(
|
||||||
`assigned_to.is.null,locked_until.lt.${now},assigned_to.eq.${userId}`
|
`assigned_to.is.null,and(locked_until.not.is.null,locked_until.lt.${now}),assigned_to.eq.${userId}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user