Merge pull request #39 from web3privacy/dw/svg-fix

fix: svg logo
This commit is contained in:
MufCZ 2024-09-24 12:48:16 +02:00 committed by GitHub
commit 4e74f6baf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,9 +36,13 @@ export default defineEventHandler(async (event) => {
] ]
if (body.image?.data && body.image?.type) { if (body.image?.data && body.image?.type) {
let extension = body.image.type.split('/')[1]
if (extension === 'svg+xml') {
extension = 'svg'
}
files.push( files.push(
{ {
path: `src/projects/${id}/logo.${body.image.type.split('/')[1]}`, path: `src/projects/${id}/logo.${extension}`,
content: body.image.data, content: body.image.data,
encoding: 'base64', encoding: 'base64',
}, },