Extend database with more tables, rewrite API doc, improve API endpoints
This commit is contained in:
1 parent
6aae064902
commit
87f3516b54
41 files changed
+1345
-1126
No files matched your search
@@ -1,7 +1,16 @@
|
||||
import axios from "axios"
|
||||
import { OrderModel } from "../models/orderModel"
|
||||
import { BasketItemModel } from "../models/basketItemModel"
|
||||
|
||||
const BASE_URL = "http://localhost:3000/orders"
|
||||
|
||||
export async function getUserOrders(userId: number) {
|
||||
return axios.get(BASE_URL + "/" + userId)
|
||||
}
|
||||
|
||||
export async function addOrder(accountId: number, basketItems: Array<BasketItemModel>) {
|
||||
return axios.post(BASE_URL, {
|
||||
"accountId": accountId,
|
||||
"orderItem": basketItems
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user