mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
fix: handle add message in frontend (#1340)
This commit is contained in:
@ -51,7 +51,11 @@ class PaymentListPage extends BaseListPage {
|
||||
const newPayment = this.newPayment();
|
||||
PaymentBackend.addPayment(newPayment)
|
||||
.then((res) => {
|
||||
this.props.history.push({pathname: `/payments/${newPayment.name}`, mode: "add"});
|
||||
if (res.status === "ok") {
|
||||
this.props.history.push({pathname: `/payments/${newPayment.name}`, mode: "add"});
|
||||
} else {
|
||||
Setting.showMessage("error", `Payment failed to add: ${res.msg}`);
|
||||
}
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
|
Reference in New Issue
Block a user