Matching UI with improved API
This commit is contained in:
1 parent
8395b4427d
commit
0b34174ce9
34 files changed
+194
-545
No files matched your search
@@ -1,9 +1,8 @@
|
||||
import { BasketItemModel } from "@/data/models/basketItemModel";
|
||||
import { CategoryModel } from "@/data/models/categoryModel";
|
||||
import { ProductModel } from "@/data/models/productModel";
|
||||
import { ProductWithCategoryModel } from "@/data/models/productWithCategoryModel";
|
||||
|
||||
export function calcProductPrice(product: ProductWithCategoryModel, quantity: number = 1): number {
|
||||
export function calcProductPrice(product: ProductModel, quantity: number = 1): number {
|
||||
return calcPrice(product.price, product.discount, quantity)
|
||||
}
|
||||
|
||||
@@ -29,7 +28,7 @@ export function calcPrice(price: number, discount: number = 0, quantity: number
|
||||
*
|
||||
* @returns BasketItemModel
|
||||
*/
|
||||
export function productToBasketItem(product: ProductWithCategoryModel, quantity: number): BasketItemModel {
|
||||
export function productToBasketItem(product: ProductModel, quantity: number): BasketItemModel {
|
||||
let result = new BasketItemModel()
|
||||
|
||||
result.productId = product.id
|
||||
|
||||
Reference in new issue
Block a user