Shop: item priority, block sort order and a Sort by menu #29

Merged
reudy merged 2 commits from session/add-service-priority into main 2026-11-10 12:00:39 +01:00
Showing only changes of commit 80cbe6ddb2 - Show all commits

View file

@ -27,8 +27,10 @@ export function mapItemRecord(record: Record<string, any>): ItemRecord {
durations: type === 'item_with_time' ? parseDurations(record.durations) : [], durations: type === 'item_with_time' ? parseDurations(record.durations) : [],
bundleParts: type === 'bundle' ? parseBundleParts(record.bundleParts) : [], bundleParts: type === 'bundle' ? parseBundleParts(record.bundleParts) : [],
validMonths: type === 'bundle' ? Number(record.validMonths) || null : null, validMonths: type === 'bundle' ? Number(record.validMonths) || null : null,
bufferMinutes: record.bufferMinutes ?? null, // PocketBase reads an empty number back as 0, never null: 0 means "not set" for both
capacity: record.capacity ?? null, // (and a 0 in the admin form would fail capacity's min of 1, blocking every save).
bufferMinutes: Number(record.bufferMinutes) || null,
capacity: Number(record.capacity) || null,
active: record.active !== false, active: record.active !== false,
priority: Number(record.priority) || 0, priority: Number(record.priority) || 0,
popularRank: null popularRank: null