Perbaikan Project PPOB

This commit is contained in:
2021-12-27 15:55:34 +07:00
parent 668c64f193
commit 8a2bde5ba8
21 changed files with 482 additions and 322 deletions

View File

@@ -27,7 +27,7 @@ export class Partner {
async getData() {
try {
const response = await http.get(`/users/partner?page=${this.page}&pageSize=${this.pageSize}`);
//console.log(response)
this.data = response.body.data.map((item, idx) => {
item.key = idx;
return item
@@ -59,11 +59,12 @@ export class Partner {
}
}
// async updateStatus(id, data) {
// const response = await http.put(`/users/partner/${id}`).send(data);
// await this.getData();
// return response;
// }
async updatePassword(id, data) {
const response = await http.put(`/users/change-password-partner/${id}`).send(data);
console.log(response)
await this.getData();
return response;
}
async delete(id) {
try {

View File

@@ -26,9 +26,11 @@ export class Product {
dataPriceHistory = [];
totalDataPriceHistory = 0;
pagePriceHistory = 0;
pageProductPartner = 0;
pageSizePriceHistory = 10
dataDetailProduct = {};
dataProductPartner=[]
constructor(ctx) {
this.ctx = ctx;
@@ -94,6 +96,16 @@ export class Product {
}
}
async getProductPartner(id) {
try {
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&sub-category=${id}`);
console.log(response)
this.dataProductPartner = response.body.data
} catch (e) {
console.error(e);
}
}
async create(data) {
try {
const response = await http.post('/product').send(data);