to request two api, sequentially, you must first delete the item, and then delete the group. Axios.all is called here, but sometimes this happens. The order in which the api is executed is fine, but it seems that sometimes the api of the group is deleted (the last one) at the backend, which causes the backend to check that it contains item, and therefore does not delete it.
export const deleteInspect=(params1,params2)=>{
return axios.all([
axios.post(`${base}${itempath}/inspect/item/delete`,params1),
axios.post(`${base}${itempath}/inspect/group/delete`,params2)
]);
}
deleteAllData(itemIdList,groupIdList){
let params1={
itemIds:itemIdList
};
let params2={
groupIds:groupIdList
};
return new Promise((resolve,reject)=>{
api.deleteInspect(params1,params2).then((res)=>{
console.log(res);
resolve(res);
})
})
}