fix: include quantity in getAllItems select, createItem values, and updateItem type
Quantity was missing from three places in item.service.ts: - getAllItems didn't select it (API returned undefined) - createItem didn't pass it to insert (always used DB default of 1) - updateItem type didn't include it (silently stripped from updates) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ export function getAllItems(db: Db = prodDb) {
|
||||
name: items.name,
|
||||
weightGrams: items.weightGrams,
|
||||
priceCents: items.priceCents,
|
||||
quantity: items.quantity,
|
||||
categoryId: items.categoryId,
|
||||
notes: items.notes,
|
||||
productUrl: items.productUrl,
|
||||
@@ -63,6 +64,7 @@ export function createItem(
|
||||
name: data.name,
|
||||
weightGrams: data.weightGrams ?? null,
|
||||
priceCents: data.priceCents ?? null,
|
||||
quantity: data.quantity ?? 1,
|
||||
categoryId: data.categoryId,
|
||||
notes: data.notes ?? null,
|
||||
productUrl: data.productUrl ?? null,
|
||||
@@ -80,6 +82,7 @@ export function updateItem(
|
||||
name: string;
|
||||
weightGrams: number;
|
||||
priceCents: number;
|
||||
quantity: number;
|
||||
categoryId: number;
|
||||
notes: string;
|
||||
productUrl: string;
|
||||
|
||||
Reference in New Issue
Block a user