Display all bands grouped by genre, create m:n association between Band and Genre in database

This commit is contained in:
2024-09-27 23:25:24 +02:00
parent 848e7abf92
commit 9b325c849e
29 changed files with 275 additions and 165 deletions

View File

@@ -1,7 +1,6 @@
import axios from "axios"
import { OrderModel } from "../models/orderModel"
import { BasketItemModel } from "../models/basketItemModel"
import { calcPrice } from "@/scripts/productScripts"
const BASE_URL = "http://localhost:3000/orders"
@@ -17,13 +16,13 @@ export async function addOrder(
) {
let orderItems = []
for (let basketItem of basketItems) {
orderItems.push({
productId: basketItem.product.id,
quantity: basketItem.quantity,
orderPrice: calcPrice(basketItem.product.price, basketItem.product.discount)
})
}
// for (let basketItem of basketItems) {
// orderItems.push({
// productId: basketItem.product.id,
// quantity: basketItem.quantity,
// orderPrice: calcPrice(basketItem.product.price, basketItem.product.discount)
// })
// }
return axios.post(BASE_URL, {
accountId: accountId,