- add productId field in request order-prod and order-stg
This commit is contained in:
parent
435e616241
commit
bc69bba068
|
@ -53,12 +53,13 @@ export const Product = observer(() => {
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBuyProduct = async (data, productCode) => {
|
const handleBuyProduct = async (data, productCode, productId) => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await store.transaction.buyProd({
|
const response = await store.transaction.buyProd({
|
||||||
...data,
|
...data,
|
||||||
productCode: productCode,
|
productCode: productCode,
|
||||||
|
productId: productId
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.status === 201) {
|
if (response.status === 201) {
|
||||||
|
@ -83,12 +84,13 @@ export const Product = observer(() => {
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBuyStag = async (data, productCode) => {
|
const handleBuyStag = async (data, productCode, productId) => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await store.transaction.buyProduct({
|
const response = await store.transaction.buyProduct({
|
||||||
...data,
|
...data,
|
||||||
productCode: productCode,
|
productCode: productCode,
|
||||||
|
productId: productId
|
||||||
});
|
});
|
||||||
if (response.status === 201) {
|
if (response.status === 201) {
|
||||||
message.success(response?.body?.message || "Berhasil Beli Produk");
|
message.success(response?.body?.message || "Berhasil Beli Produk");
|
||||||
|
@ -222,7 +224,7 @@ export const Product = observer(() => {
|
||||||
.validateFields()
|
.validateFields()
|
||||||
.then((values) => {
|
.then((values) => {
|
||||||
console.log(values, "isi form");
|
console.log(values, "isi form");
|
||||||
handleBuyProduct(values, barang.product_code);
|
handleBuyProduct(values, barang.product_code, barang.product_id);
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
})
|
})
|
||||||
.catch((info) => {
|
.catch((info) => {
|
||||||
|
|
|
@ -78,12 +78,13 @@ export const Transaction = observer(() => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleBuyProduct = async (data, productCode) => {
|
const handleBuyProduct = async (data, productCode, productId) => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await store.transaction.buyProd({
|
const response = await store.transaction.buyProd({
|
||||||
...data,
|
...data,
|
||||||
productCode: productCode,
|
productCode: productCode,
|
||||||
|
productId: productId
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.status === 201) {
|
if (response.status === 201) {
|
||||||
|
@ -308,7 +309,7 @@ export const Transaction = observer(() => {
|
||||||
.validateFields()
|
.validateFields()
|
||||||
.then((values) => {
|
.then((values) => {
|
||||||
console.log(values, "isi form");
|
console.log(values, "isi form");
|
||||||
handleBuyProduct(values, barang.product_code);
|
handleBuyProduct(values, barang.product_code, barang.product_id);
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
})
|
})
|
||||||
.catch((info) => {
|
.catch((info) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user