Shop: item priority, block sort order and a Sort by menu #29
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue