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
|
|
@ -125,7 +125,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
|||
const { data: settings } = useQuery<{ llm_enabled?: boolean; anthropic_api_key_set?: boolean }>({
|
||||
queryKey: ['settings'],
|
||||
queryFn: async () => {
|
||||
const res = await fetch('/api/settings', { headers: { Authorization: `Bearer ${token}` } })
|
||||
const res = await fetch('/kitchen/api/settings', { headers: { Authorization: `Bearer ${token}` } })
|
||||
if (!res.ok) return {}
|
||||
return res.json()
|
||||
},
|
||||
|
|
@ -136,7 +136,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
|||
const { data: dispute, isLoading, error } = useQuery<DisputeDetail>({
|
||||
queryKey: ['dispute', disputeId],
|
||||
queryFn: async () => {
|
||||
const res = await fetch(`/api/disputes/${disputeId}`, {
|
||||
const res = await fetch(`/kitchen/api/disputes/${disputeId}`, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
if (!res.ok) throw new Error('Failed to fetch dispute')
|
||||
|
|
@ -147,7 +147,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
|||
|
||||
const updateMutation = useMutation({
|
||||
mutationFn: async (data: { status?: string; priority?: string; supplier_response?: string; supplier_contact_name?: string; title?: string; description?: string }) => {
|
||||
const res = await fetch(`/api/disputes/${disputeId}`, {
|
||||
const res = await fetch(`/kitchen/api/disputes/${disputeId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
@ -172,7 +172,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
|||
|
||||
const deleteMutation = useMutation({
|
||||
mutationFn: async () => {
|
||||
const res = await fetch(`/api/disputes/${disputeId}`, {
|
||||
const res = await fetch(`/kitchen/api/disputes/${disputeId}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
|
|
@ -251,7 +251,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
|||
setAiEmailSubject('')
|
||||
setAiEmailBody('')
|
||||
try {
|
||||
const res = await fetch(`/api/disputes/${disputeId}/draft-email`, {
|
||||
const res = await fetch(`/kitchen/api/disputes/${disputeId}/draft-email`, {
|
||||
method: 'POST',
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
|
|
@ -290,7 +290,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
|||
params.append('description', uploadDescription.trim())
|
||||
}
|
||||
|
||||
const res = await fetch(`/api/disputes/${disputeId}/attachments?${params}`, {
|
||||
const res = await fetch(`/kitchen/api/disputes/${disputeId}/attachments?${params}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue