[dyad] Corrected customer name mapping in BookOutForm - wrote 1 file(s)

This commit is contained in:
[dyad] 2025-09-12 16:16:33 +02:00
parent b5ae31b1dd
commit 22dbfc3884

View file

@ -55,7 +55,7 @@ type StockItem = {
// Define the type for a customer
type Customer = {
id: string
name: string
name: string // This will be the label in the combobox
}
export function BookOutForm({ setOpen, refreshData }: BookOutFormProps) {
@ -90,7 +90,7 @@ export function BookOutForm({ setOpen, refreshData }: BookOutFormProps) {
});
const formattedCustomers: Customer[] = records.items.map((item: any) => ({
id: item.id,
name: item.company_name, // Assuming 'company_name' is the field for customer name
name: item.company_name, // Assuming 'company_name' is the field for customer name in PocketBase
}));
setCustomers(formattedCustomers);
} catch (error) {