fix: handler error buy producy
This commit is contained in:
parent
757c0c291e
commit
88260e97b2
|
@ -61,12 +61,16 @@ export const Product = observer(() => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await store.transaction.buyProduct({productCode: data});
|
const response = await store.transaction.buyProduct({productCode: data});
|
||||||
// if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
message.success("Success Buy Product");
|
message.success("Success Buy Product");
|
||||||
// } else {
|
} else {
|
||||||
//message.error("Failed Buy Product");
|
message.error("Failed Buy Product", 3);
|
||||||
//}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (e.response?.body?.message) {
|
||||||
|
message.error(e.response.body.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log(e, "apa errornya");
|
console.log(e, "apa errornya");
|
||||||
message.error("Failed Buy Product");
|
message.error("Failed Buy Product");
|
||||||
}
|
}
|
||||||
|
@ -148,11 +152,11 @@ export const Product = observer(() => {
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
{productData.length !== 0 && (
|
{productData.length !== 0 && (
|
||||||
<Col style={{textAlign: "right"}}>
|
<Col style={{textAlign: "right", marginTop: "1em"}}>
|
||||||
<Button style={{backgroundColor: "#2D9CDB", color: "white"}}>
|
<Button style={{backgroundColor: "#2D9CDB", color: "white"}}>
|
||||||
Beli Sekarang
|
Beli Sekarang
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user