From 165e33b1888478003e081dd325c7752ead67ef7c Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Sun, 3 Mar 2024 12:01:05 +0000 Subject: [PATCH] Updated an error with the session --- src/pages/api/storage/insert.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/api/storage/insert.ts b/src/pages/api/storage/insert.ts index bd664ff8..f74d84e5 100644 --- a/src/pages/api/storage/insert.ts +++ b/src/pages/api/storage/insert.ts @@ -28,7 +28,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { } const audioFile = files.audio; - const audioFileRef = ref(storage, `${fields.root}/${(audioFile as any).path.split("/").pop()!.replace("upload_", "")}`); + const audioFileRef = ref(storage, `${fields.root}/${(audioFile as any).path.replace("upload_", "")}`); const binary = fs.readFileSync((audioFile as any).path).buffer; const snapshot = await uploadBytes(audioFileRef, binary);