From a926b2553ad35872592767240493f360d67da6ee Mon Sep 17 00:00:00 2001 From: DomWane Date: Tue, 24 Sep 2024 12:47:05 +0200 Subject: [PATCH] fix: svg logo --- server/api/data.post.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/api/data.post.ts b/server/api/data.post.ts index f975bfe..66e3c5e 100644 --- a/server/api/data.post.ts +++ b/server/api/data.post.ts @@ -36,9 +36,13 @@ export default defineEventHandler(async (event) => { ] if (body.image?.data && body.image?.type) { + let extension = body.image.type.split('/')[1] + if (extension === 'svg+xml') { + extension = 'svg' + } files.push( { - path: `src/projects/${id}/logo.${body.image.type.split('/')[1]}`, + path: `src/projects/${id}/logo.${extension}`, content: body.image.data, encoding: 'base64', },