fix nan error

This commit is contained in:
tonoyan
2026-04-13 15:57:00 +03:00
parent 4318a66e7a
commit 2bfc1e5f68

View File

@@ -689,7 +689,7 @@ export const mockDataInterceptor: HttpInterceptorFn = (req, next) => {
}
// ── GET /category/:id (items for a category)
const catItemsMatch = url.match(/\/category\/(\d+)$/);
const catItemsMatch = url.match(/\/category\/(\d+)(?:\?|$)/);
if (catItemsMatch && req.method === 'GET') {
const catId = parseInt(catItemsMatch[1], 10);
const items = getItemsByCategoryId(catId);
@@ -697,7 +697,7 @@ export const mockDataInterceptor: HttpInterceptorFn = (req, next) => {
}
// ── GET /item/:id
const itemMatch = url.match(/\/item\/(\d+)$/);
const itemMatch = url.match(/\/item\/(\d+)(?:\?|$)/);
if (itemMatch && req.method === 'GET') {
const itemId = parseInt(itemMatch[1], 10);
const item = MOCK_ITEMS.find(i => i.itemID === itemId);
@@ -756,7 +756,7 @@ export const mockDataInterceptor: HttpInterceptorFn = (req, next) => {
}
// ── POST /items/:id/callback (review)
if (url.match(/\/items\/\d+\/callback$/) && req.method === 'POST') {
if (url.match(/\/items\/\d+\/callback(?:\?|$)/) && req.method === 'POST') {
return respond({ message: 'Review submitted (mock)' }, 200);
}