Add partial report information to d1
This commit is contained in:
@ -9,9 +9,14 @@ export async function onRequestPost(context: RequestContext) {
|
||||
status: 400,
|
||||
});
|
||||
|
||||
const userId = await context.env.DATA.get(`reportprocessing_${id}`);
|
||||
const user = await context.env.DATA.get(`reportprocessing_${id}`);
|
||||
|
||||
if (!userId || userId !== context.data.current_user.id)
|
||||
if (
|
||||
!user ||
|
||||
(context.data.current_user
|
||||
? user !== context.data.current_user.id
|
||||
: user !== context.request.headers.get("CF-Connecting-IP"))
|
||||
)
|
||||
return new Response('{"error":"No report with that ID is processing"}', {
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
|
Reference in New Issue
Block a user