mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 06:51:23 -05:00
Fix Supabase OR filter syntax
This commit is contained in:
@@ -324,6 +324,7 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
|
|||||||
.single();
|
.single();
|
||||||
|
|
||||||
const expiresAt = new Date(Date.now() + 15 * 60 * 1000);
|
const expiresAt = new Date(Date.now() + 15 * 60 * 1000);
|
||||||
|
const now = new Date().toISOString();
|
||||||
|
|
||||||
const { error } = await supabase
|
const { error } = await supabase
|
||||||
.from('content_submissions')
|
.from('content_submissions')
|
||||||
@@ -333,7 +334,7 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
|
|||||||
locked_until: expiresAt.toISOString(),
|
locked_until: expiresAt.toISOString(),
|
||||||
})
|
})
|
||||||
.eq('id', submissionId)
|
.eq('id', submissionId)
|
||||||
.or(`assigned_to.is.null,locked_until.lt.${new Date().toISOString()}`); // Only if unclaimed or lock expired
|
.or(`assigned_to.is.null,locked_until.lt."${now}"`); // Only if unclaimed or lock expired
|
||||||
|
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user