add confirm box
This commit is contained in:
@@ -44,13 +44,16 @@ class WristbandInfo extends React.Component {
|
||||
|
||||
delWristband = (id) => {
|
||||
if(!id) return ;
|
||||
let {showDialog, callConfirm} = this.props;
|
||||
|
||||
fetch('/api/wristband/delwristband', getRequest({id}))
|
||||
.then(response=>response.json())
|
||||
.then(json=>{
|
||||
if(json.status!=1) return showDialog(json.message);
|
||||
this.getList();
|
||||
})
|
||||
callConfirm('確定要刪除這筆手環資料?', ()=>{
|
||||
fetch('/api/wristband/delwristband', getRequest({id}))
|
||||
.then(response=>response.json())
|
||||
.then(json=>{
|
||||
if(json.status!=1) return showDialog(json.message);
|
||||
this.getList();
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
openModal = (type, data = {}) => {
|
||||
|
||||
Reference in New Issue
Block a user