feat: add buy product

This commit is contained in:
caturbgs
2021-12-17 01:43:42 +07:00
parent 319948376a
commit 29f97f751a
3 changed files with 88 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ export class Transaction {
total_data = 0;
filterSubCategory = null;
visibleModalProduct = false;
visibleModalTransaction = false;
pageCategories = 0;
pageSizeCategories = 10
@@ -85,6 +86,15 @@ export class Transaction {
}
}
async buyProduct(data) {
try {
const response = await http.post('/transaction/order').send(data);
return response;
} catch (e) {
console.error(e);
}
}
async update(id, data) {
try {
const response = await http.put(`/product/${id}`).send(data);