Add rectangular logo upload to settings, support SVG content type
Settings page now shows a rectangular upload area for the store logo instead of circular avatar. Uses authenticated image fetching with blob URL cleanup. Accepts SVG in addition to JPEG/PNG/WebP. SVG added to file serve content type map. Simplified to single logo image (used on PDFs, sidebar, and login).
This commit is contained in:
@@ -90,7 +90,7 @@ export const fileRoutes: FastifyPluginAsync = async (app) => {
|
||||
const data = await app.storage.get(filePath)
|
||||
const ext = filePath.split('.').pop()?.toLowerCase()
|
||||
const contentTypeMap: Record<string, string> = {
|
||||
jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp', pdf: 'application/pdf',
|
||||
jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp', svg: 'image/svg+xml', pdf: 'application/pdf',
|
||||
}
|
||||
return reply
|
||||
.header('Content-Type', contentTypeMap[ext ?? ''] ?? 'application/octet-stream')
|
||||
@@ -154,7 +154,7 @@ export const fileRoutes: FastifyPluginAsync = async (app) => {
|
||||
const data = await app.storage.get(filePath)
|
||||
const ext = filePath.split('.').pop()?.toLowerCase()
|
||||
const contentTypeMap: Record<string, string> = {
|
||||
jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp', pdf: 'application/pdf',
|
||||
jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp', svg: 'image/svg+xml', pdf: 'application/pdf',
|
||||
}
|
||||
return reply
|
||||
.header('Content-Type', contentTypeMap[ext ?? ''] ?? 'application/octet-stream')
|
||||
|
||||
Reference in New Issue
Block a user