Procházet zdrojové kódy

Serve tire-hotel, inspection and document files over share links (#285)

Bernt Christian Egeland před 1 měsícem
rodič
revize
e5e186641e

+ 13 - 1
src/app/api/public/files/[token]/[...path]/route.ts

@@ -31,7 +31,19 @@ export async function GET(
 
   const [category, filename] = segments
 
-  const allowedCategories = ['vehicles', 'inventory', 'services', 'logos', 'quotes']
+  // Every folder a shared document's images and attachments can live in. A
+  // tire-hotel job's photos sat under its own folder, which this list did not
+  // know, so its share link showed every image but those.
+  const allowedCategories = [
+    'vehicles',
+    'inventory',
+    'services',
+    'logos',
+    'quotes',
+    'tire-hotel',
+    'inspections',
+    'documents',
+  ]
   if (!allowedCategories.includes(category)) {
     return NextResponse.json({ error: 'Invalid category' }, { status: 400 })
   }