diff --git a/frontend/app/src/api/mock/MockApiCustomers.ts b/frontend/app/src/api/mock/MockApiCustomers.ts index 1d4745b..d564c3d 100644 --- a/frontend/app/src/api/mock/MockApiCustomers.ts +++ b/frontend/app/src/api/mock/MockApiCustomers.ts @@ -18,4 +18,5 @@ export class MockApiCustomers { createCustomer(customer: Customer) { return {...customer, id: 999} } + } \ No newline at end of file diff --git a/frontend/app/src/api/mock/MockApiSales.ts b/frontend/app/src/api/mock/MockApiSales.ts index c6d0f29..0fb66d7 100644 --- a/frontend/app/src/api/mock/MockApiSales.ts +++ b/frontend/app/src/api/mock/MockApiSales.ts @@ -178,7 +178,7 @@ export class MockApiSales { } }, { id: 222, - unitPrice: 160, + unitPrice: 16, quantity: 1, packageLot: { id: 2, diff --git a/frontend/app/src/domains/customer/views/CustomersList.tsx b/frontend/app/src/domains/customer/views/CustomersList.tsx index 3f7962a..0ee27ca 100644 --- a/frontend/app/src/domains/customer/views/CustomersList.tsx +++ b/frontend/app/src/domains/customer/views/CustomersList.tsx @@ -20,11 +20,11 @@ export default function CustomersList() { function loadCustomers() { apiBuilder.getAuthenticatedApi(keycloak).then(api => { apiBuilder.invokeAuthenticatedApi(() => { - api.getCustomers((error, data, response) => { + api.getProducerCustomers((error, data, response) => { if (error) { console.error(error) } else { - console.log('api.getSales called successfully. Returned data: ' + data) + console.log('api.getProducerCustomers called successfully. Returned data: ' + data) setCustomers(data) } }) diff --git a/frontend/app/src/domains/sale/components/OrderSummary.tsx b/frontend/app/src/domains/sale/components/OrderSummary.tsx index bc7524e..b05059b 100644 --- a/frontend/app/src/domains/sale/components/OrderSummary.tsx +++ b/frontend/app/src/domains/sale/components/OrderSummary.tsx @@ -39,7 +39,7 @@ export default function OrderSummary({ order: order }) { } function orderTotalPrice(order: Order): String { - return order.items.map(item => item.quantity * item.packageLot.quantity * item.packageLot.unitPrice) + return order.items?.map(item => item.quantity * item.packageLot.netWeight * item.unitPrice) .reduce((totalPrice, itemPrice) => totalPrice + itemPrice) } } \ No newline at end of file diff --git a/frontend/app/src/domains/sale/views/OrderForm.tsx b/frontend/app/src/domains/sale/views/OrderForm.tsx index 68704d9..76df4c2 100644 --- a/frontend/app/src/domains/sale/views/OrderForm.tsx +++ b/frontend/app/src/domains/sale/views/OrderForm.tsx @@ -56,7 +56,7 @@ export default function OrderForm({ sale: sale, returnCallback: returnCallback } function loadCustomers() { apiBuilder.getAuthenticatedApi(keycloak).then(api => { apiBuilder.invokeAuthenticatedApi(() => { - api.getCustomers((error, data, response) => { + api.getProducerCustomers((error, data, response) => { if (error) { console.error(error) } else {