Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add processing key check for reports
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent c7945de commit e84b02c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions functions/api/mod-queue/[type]/[id].ts
Expand Up @@ -34,6 +34,17 @@ export async function onRequestGet(context: RequestContext) {
if (!item)
item = await context.env.DATA.get(`closed${types[type].prefix}${itemId}`);

if (
type === "report" &&
(await context.env.DATA.get(`reportprocessing_${itemId}`))
)
return new Response('{"error":"Report is processing"}', {
headers: {
"content-type": "application/json",
},
status: 409,
});

return new Response(item ? item : '{"error":"Not found"}', {
headers: {
"content-type": "application/json",
Expand Down

0 comments on commit e84b02c

Please sign in to comment.