Fix invoice file 500 and pdf.worker MIME error
- Remove stale import of non-existent require_cap_from_token from get_invoice_file endpoint — caused ImportError → 500 on every PDF load - Fix pdf.js worker path from '/pdf.worker.min.mjs' to '/kitchen/pdf.worker.min.mjs' in Review.tsx and SearchDefinitions.tsx — worker was being fetched from domain root instead of under the /kitchen/ base, causing MIME type rejection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1502ab8ed2
commit
cd9e7dbfef
3 changed files with 2 additions and 3 deletions
|
|
@ -1237,7 +1237,6 @@ async def get_invoice_file(
|
||||||
db: AsyncSession = Depends(get_db)
|
db: AsyncSession = Depends(get_db)
|
||||||
):
|
):
|
||||||
"""Get invoice file (image or PDF) with token in query param - works through proxies"""
|
"""Get invoice file (image or PDF) with token in query param - works through proxies"""
|
||||||
from auth import get_current_user, require_cap_from_token
|
|
||||||
from starlette.responses import Response
|
from starlette.responses import Response
|
||||||
from services.file_archival_service import FileArchivalService
|
from services.file_archival_service import FileArchivalService
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import IngredientModal from './IngredientModal'
|
||||||
import { IngredientModalResult, LineItemResult } from '../utils/ingredientHelpers'
|
import { IngredientModalResult, LineItemResult } from '../utils/ingredientHelpers'
|
||||||
|
|
||||||
// Use local worker file from public directory
|
// Use local worker file from public directory
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs'
|
pdfjsLib.GlobalWorkerOptions.workerSrc = '/kitchen/pdf.worker.min.mjs'
|
||||||
|
|
||||||
// Simple Scale icon SVG component
|
// Simple Scale icon SVG component
|
||||||
const ScaleIcon = ({ style }: { style?: React.CSSProperties }) => (
|
const ScaleIcon = ({ style }: { style?: React.CSSProperties }) => (
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
import * as pdfjsLib from 'pdfjs-dist'
|
import * as pdfjsLib from 'pdfjs-dist'
|
||||||
|
|
||||||
// Configure PDF.js worker
|
// Configure PDF.js worker
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs'
|
pdfjsLib.GlobalWorkerOptions.workerSrc = '/kitchen/pdf.worker.min.mjs'
|
||||||
|
|
||||||
interface ProductDefinition {
|
interface ProductDefinition {
|
||||||
id: number
|
id: number
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue