Rest of it
This commit is contained in:
@@ -40,11 +40,17 @@ export async function loader({ context }: { context: RequestContext }) {
|
||||
!Boolean(disabled) &&
|
||||
!Boolean(await dataKV.get(`blockedappeal_${currentUser.id}`)) &&
|
||||
!Boolean(
|
||||
await context.env.D1.prepare(
|
||||
"SELECT * FROM appeals WHERE approved IS NULL AND json_extract(user, '$.id') = ? LIMIT 1;",
|
||||
)
|
||||
.bind(currentUser.id)
|
||||
.first(),
|
||||
await context.data.prisma.appeal.findFirst({
|
||||
select: {
|
||||
id: true,
|
||||
},
|
||||
where: {
|
||||
user: {
|
||||
path: "id",
|
||||
equals: currentUser.id,
|
||||
},
|
||||
},
|
||||
}),
|
||||
),
|
||||
can_toggle:
|
||||
currentUser.permissions & (1 << 0) || currentUser.permissions & (1 << 11),
|
||||
|
||||
Reference in New Issue
Block a user