Skip to content

Commit

Permalink
removed console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasgauvin committed Mar 20, 2024
1 parent 704ca8d commit 292c7d3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion pages/Sales/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
console.error("Please fill out all fields");
return;
}
console.log(formData.value.date)
formData.value.date = new Date(formData.value.date).toISOString();
const { data: newSale, error} = await useFetch('/api/Sales', {
method: 'POST',
Expand Down
1 change: 0 additions & 1 deletion pages/Sales/Edit/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ formData.value = {
date: new Date(item.value.date).toISOString().split("T")[0],
items: item.value.items,
};
console.log(formData.value);
// Function to handle form submission
const handleSubmit = async () => {
Expand Down
4 changes: 0 additions & 4 deletions pages/Sales/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ let itemPrices = {};
const { data: sales, refresh: refreshSales } = await useFetch("/api/Sales");
const { data: items, refresh: refreshItems } = await useFetch("/api/Items");
if (items) {
console.log(items.value)
for(let i = 0; i < items.value.length; i++) {
itemPrices[items.value[i].id] = items.value[i].price;
}
Expand All @@ -101,14 +100,11 @@ const handleDelete = async (saleId) => {
};
const calculateRevenueForItem = (item, quantity) => {
console.log(itemPrices)
console.log(item, quantity, itemPrices[item.id])
const itemPrice = itemPrices[item.id] || 0; // Use 0 if price is not available
return itemPrice * quantity;
};
const calculateTotalRevenue = (sale) => {
console.log(sale.items, itemPrices)
return sale.items.reduce((acc, item) => {
const itemPrice = itemPrices[item.id] || 0; // Use 0 if price is not available
return acc + itemPrice * item.quantity;
Expand Down

0 comments on commit 292c7d3

Please sign in to comment.