Fix existing appeal check

This commit is contained in:
Regalijan 2024-05-15 14:36:29 -04:00
parent 90f7a93d46
commit 111b25b3da
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -41,7 +41,7 @@ export async function loader({ context }: { context: RequestContext }) {
!Boolean(await dataKV.get(`blockedappeal_${currentUser.id}`)) &&
!Boolean(
await context.env.D1.prepare(
"SELECT * FROM appeals WHERE open = 1 AND user = ? LIMIT 1;",
"SELECT * FROM appeals WHERE approved IS NULL AND json_extract(user, '$.id') = ? LIMIT 1;",
)
.bind(currentUser.id)
.first(),