Fix report fetch links

This commit is contained in:
Regalijan 2024-05-15 14:56:08 -04:00
parent 111b25b3da
commit 1d22fd91b1
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -42,11 +42,14 @@ export async function onRequestGet(context: RequestContext) {
if (!item) return jsonError("Item not found", 404); if (!item) return jsonError("Item not found", 404);
if ( if (type === "report") {
type === "report" && if (await context.env.DATA.get(`reportprocessing_${itemId}`))
(await context.env.DATA.get(`reportprocessing_${itemId}`)) return jsonError("Report is processing", 409);
)
return jsonError("Report is processing", 409); item.attachments = JSON.parse(item.attachments);
item.target_ids = JSON.parse(item.target_ids);
item.target_usernames = JSON.parse(item.target_usernames);
}
if (item.user) { if (item.user) {
item.user = JSON.parse(item.user); item.user = JSON.parse(item.user);