dist files for v1.4.0 built

This commit is contained in:
Kantine Wrapper
2026-02-22 21:40:41 +01:00
parent 4c55e34bc1
commit f19827ae91
11 changed files with 374 additions and 35 deletions

View File

@@ -128,8 +128,31 @@
// Orders endpoint
if (urlStr.includes('/user/orders/') && (!options || options.method === 'GET' || !options.method)) {
console.log('[MOCK] Returning mock orders');
// Formatter for history mapping
const mappedOrders = mockOrders.map(o => ({
id: o.id,
date: `${o.date}T10:00:00Z`,
order_state: o.status === 'cancelled' ? 9 : 5,
total: o.price || '6.50',
items: [{
article: o.article,
name: o.article_name,
price: o.price || '6.50',
amount: 1
}]
}));
// Handle lazy load / pagination if requesting full history
if (urlStr.includes('limit=50')) {
return Promise.resolve(new Response(JSON.stringify({
count: mappedOrders.length,
next: null,
results: mappedOrders
}), { status: 200, headers: { 'Content-Type': 'application/json' } }));
}
return Promise.resolve(new Response(JSON.stringify({
results: mockOrders
results: mappedOrders
}), { status: 200, headers: { 'Content-Type': 'application/json' } }));
}