From f408e7e7aa32e4f013f2bf5b12a51fd6884cd464 Mon Sep 17 00:00:00 2001 From: AJFrio Date: Thu, 28 May 2026 15:40:56 -0600 Subject: [PATCH] Fix admin API paths and Puck CSP stylesheet import. Correct store-settings and fulfillment order endpoints to match the worker routes, and switch Puck to no-external.css so the page editor loads under CSP. Co-authored-by: Cursor --- src/components/admin/ProductWorkspace.jsx | 2 +- src/components/admin/PuckPageEditor.jsx | 2 +- src/pages/admin/FulfillmentPage.jsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/admin/ProductWorkspace.jsx b/src/components/admin/ProductWorkspace.jsx index af9425e..ff2ff89 100644 --- a/src/components/admin/ProductWorkspace.jsx +++ b/src/components/admin/ProductWorkspace.jsx @@ -370,7 +370,7 @@ export function ProductWorkspace() { const fetchStoreSettings = async () => { try { - const settingsRes = await adminApiRequest('/api/admin/settings/store-settings') + const settingsRes = await adminApiRequest('/api/admin/store-settings') if (settingsRes.ok) { const settingsData = await settingsRes.json() setStoreSettings(settingsData) diff --git a/src/components/admin/PuckPageEditor.jsx b/src/components/admin/PuckPageEditor.jsx index 21c89c0..7e3b075 100644 --- a/src/components/admin/PuckPageEditor.jsx +++ b/src/components/admin/PuckPageEditor.jsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from 'react' import { Puck } from '@puckeditor/core' -import '@puckeditor/core/puck.css' +import '@puckeditor/core/no-external.css' import { adminApiRequest } from '../../lib/auth' import { createPageBuilderConfig } from '../storefront/page-builder/config' diff --git a/src/pages/admin/FulfillmentPage.jsx b/src/pages/admin/FulfillmentPage.jsx index b4c26f6..0280827 100644 --- a/src/pages/admin/FulfillmentPage.jsx +++ b/src/pages/admin/FulfillmentPage.jsx @@ -37,7 +37,7 @@ export function FulfillmentPage() { }) if (cursor) params.set('cursor', cursor) if (dir) params.set('direction', dir) - const res = await adminApiRequest(`/api/admin/orders?${params.toString()}`) + const res = await adminApiRequest(`/api/admin/analytics/orders?${params.toString()}`) if (!res.ok) throw new Error('Failed to fetch orders') const data = await res.json() setOrders(data.orders || []) @@ -53,7 +53,7 @@ export function FulfillmentPage() { const fulfillOrder = async (orderId) => { try { - const res = await adminApiRequest(`/api/admin/orders/${orderId}/fulfill`, { + const res = await adminApiRequest(`/api/admin/analytics/orders/${orderId}/fulfill`, { method: 'POST', }) if (!res.ok) throw new Error('Failed to fulfill order')