Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix attachment url generation
  • Loading branch information
regalijan committed Mar 26, 2024
1 parent 1ed905f commit f864054
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions functions/api/reports/submit.ts
@@ -1,5 +1,5 @@
import { jsonError, jsonResponse } from "../../common.js";
import upload from "../upload.js";
import upload from "../../upload.js";

export async function onRequestPost(context: RequestContext) {
const {
Expand Down Expand Up @@ -203,12 +203,7 @@ export async function onRequestPost(context: RequestContext) {

for (const urlResult of uploadUrlResults as PromiseFulfilledResult<string>[]) {
uploadUrls.push(urlResult.value);

let url = (
new URL(urlResult.value).searchParams.get("name") as string
).replace(/^t\//, "");

attachments.push(url);
attachments.push(urlResult.value.replace(/^t\//, ""));
}

await context.env.DATA.put(
Expand Down

0 comments on commit f864054

Please sign in to comment.