+
+
+
Sub Category
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
Produk & Nominal
@@ -115,7 +115,7 @@ export const Product = observer(() => {
{
- setVisibleModalBuy(true)
+ setVisibleModalBuy(true);
}}
hoverable
style={{
@@ -123,12 +123,12 @@ export const Product = observer(() => {
marginLeft: 10,
borderColor: "salmon",
height: 100,
- marginBottom: 10
+ marginBottom: 10,
}}
>
- {item.product_name}
-
-
+ {item.product_name}
+
+
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
@@ -137,34 +137,47 @@ export const Product = observer(() => {
{
- form.resetFields();
- handleCancel();
- }}
- onOk={() => {
- form
- .validateFields()
- .then((values) => {
- console.log(values, "isi form");
- handleBuyProduct(values, item.product_code);
- form.resetFields();
- })
- .catch((info) => {
- console.error("Validate Failed:", info);
- });
- }}
+ visible={visibleModalBuy}
+ title={`Are you sure buy ${item.product_name}?`}
+ okText={"Confirm"}
+ cancelText="Cancel"
+ onCancel={() => {
+ form.resetFields();
+ handleCancel();
+ }}
+ onOk={() => {
+ form
+ .validateFields()
+ .then((values) => {
+ console.log(values, "isi form");
+ handleBuyProduct(values, item.product_code);
+ form.resetFields();
+ })
+ .catch((info) => {
+ console.error("Validate Failed:", info);
+ });
+ }}
>
-
+
diff --git a/src/store/authentication.js b/src/store/authentication.js
index 2d2ee4d..6cde95a 100644
--- a/src/store/authentication.js
+++ b/src/store/authentication.js
@@ -2,6 +2,7 @@ import {makeAutoObservable, runInAction} from "mobx";
import {TokenUtil} from "../utils/token";
import {http} from "../utils/http";
+
export class Authentication {
isLoggedIn = false;
isLoginLoading = false;
@@ -53,6 +54,7 @@ export class Authentication {
async getProfile() {
try {
const response = await http.get('/auth/profile');
+ console.log(response)
this.profileData = response.body;
} catch (e) {
console.error(e);
diff --git a/src/store/membership.js b/src/store/membership.js
index 197eb89..a9f78cb 100644
--- a/src/store/membership.js
+++ b/src/store/membership.js
@@ -21,7 +21,7 @@ export class Membership {
async getData() {
try {
- const response = await http.get(`/users?page=${this.page}&pageSize=${this.pageSize}&superrior=${this.filterMembership}&type=${this.filterPartner}`);
+ const response = await http.get(`/users?page=${this.page}&pageSize=${this.pageSize}&superior=${this.filterMembership}&type=${this.filterPartner}`);
// console.log(this.filterMembership)
// console.log(this.filterPartner)
// console.log(response)
diff --git a/src/store/transaction.js b/src/store/transaction.js
index 47cba84..32be61d 100644
--- a/src/store/transaction.js
+++ b/src/store/transaction.js
@@ -30,6 +30,7 @@ export class Transaction {
pageSizeHistoryTopUp = 10;
dataHistoryTopUp = [];
total_dataHistoryTopUp = 0;
+ dataTransaction=[]
//filter
visibleModalFilterTransaction = false;
@@ -52,6 +53,19 @@ export class Transaction {
}
}
+ async getDataTransaction() {
+ try {
+ const response = await http.get(
+ `/transaction/total-order`
+ );
+ //console.log(response)
+ this.dataTransaction = response.body.data ?? [];
+ this.total_data = response?.body?.count ?? 0;
+ } catch (e) {
+ console.error(e);
+ }
+ }
+
async getDataSubCategories() {
try {
const response = await http.get(