ui using new v1 api for products
This commit is contained in:
@@ -22,7 +22,7 @@ type PlatformOption = {
|
||||
};
|
||||
|
||||
// Backend currently filters products by canonical platform strings like "AR-15".
|
||||
// DB platform keys are like "AR15" / "AR9". Translate when calling /api/products.
|
||||
// DB platform keys are like "AR15" / "AR9". Translate when calling /api/v1/products.
|
||||
const platformKeyToApiPlatform = (key: string) => {
|
||||
const k = (key ?? "").toUpperCase().trim();
|
||||
if (!k) return "AR-15";
|
||||
@@ -123,7 +123,7 @@ export default function AdminProductsPage() {
|
||||
const apiPlatform = platformKeyToApiPlatform(platform);
|
||||
|
||||
// NOTE: backend endpoint expects `platform`, not `platformKey`.
|
||||
const url = `${API_BASE_URL}/api/products?platform=${encodeURIComponent(
|
||||
const url = `${API_BASE_URL}/api/v1/products?platform=${encodeURIComponent(
|
||||
apiPlatform
|
||||
)}`;
|
||||
|
||||
@@ -402,7 +402,7 @@ export default function AdminProductsPage() {
|
||||
)}
|
||||
|
||||
<div className="mt-3 text-[0.7rem] text-zinc-500">
|
||||
Backend: <span className="font-mono text-zinc-400">{API_BASE_URL}</span> · Endpoint: <span className="font-mono text-zinc-400">/api/products?platform=...</span> · Page size: <span className="font-mono text-zinc-400">{pageSize}</span>
|
||||
Backend: <span className="font-mono text-zinc-400">{API_BASE_URL}</span> · Endpoint: <span className="font-mono text-zinc-400">/api/v1/products?platform=...</span> · Page size: <span className="font-mono text-zinc-400">{pageSize}</span>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user