Migrate all kitchen frontend fetch calls to /kitchen/api/ prefix (B5b)
All archive components were calling fetch('/api/...') directly. Replaced
all occurrences of /api/ URLs (string literals, template literals,
window.open, src attributes) with /kitchen/api/ across 37 source files.
The central axios instance in api.ts was already correct.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ecd63fc65f
commit
9905d0e0dd
51 changed files with 453 additions and 453 deletions
|
|
@ -35,7 +35,7 @@ export default function PurchaseOrderList() {
|
|||
const { data: suppliersData } = useQuery<{ suppliers: Array<{ id: number; name: string }> }>({
|
||||
queryKey: ['suppliers'],
|
||||
queryFn: async () => {
|
||||
const res = await fetch('/api/suppliers/', {
|
||||
const res = await fetch('/kitchen/api/suppliers/', {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to fetch suppliers')
|
||||
|
|
@ -52,7 +52,7 @@ export default function PurchaseOrderList() {
|
|||
const { data: poList, refetch } = useQuery<PurchaseOrderSummary[]>({
|
||||
queryKey: ['purchase-orders', statusFilter, supplierFilter],
|
||||
queryFn: async () => {
|
||||
const res = await fetch(`/api/purchase-orders/?${params}`, {
|
||||
const res = await fetch(`/kitchen/api/purchase-orders/?${params}`, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to fetch purchase orders')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue