Added a log for when there is an error

This commit is contained in:
Tiago Ribeiro
2023-08-31 09:05:15 +01:00
parent c23c07ae38
commit b75a0be52c

View File

@@ -20,6 +20,8 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
const form = formidable({keepExtensions: true}); const form = formidable({keepExtensions: true});
await form.parse(req, async (err: any, fields: any, files: any) => { await form.parse(req, async (err: any, fields: any, files: any) => {
if (err) console.log(err);
const audioFile = files.audio; const audioFile = files.audio;
const audioFileRef = ref(storage, `speaking_recordings/${(audioFile as any).path.replace("upload_", "")}`); const audioFileRef = ref(storage, `speaking_recordings/${(audioFile as any).path.replace("upload_", "")}`);