feat(input-csv-twice): add alert to axios post callback

This commit is contained in:
dancingCycle 2023-06-26 05:48:36 +02:00
parent 22187e6564
commit 023c002b2a
1 changed files with 8 additions and 1 deletions

View File

@ -58,7 +58,14 @@ const CsvReader = () => {
//console.log('post() start...');
//console.log('post() requestBody: ' + JSON.stringify(requestBody));
/*If you pass a JavaScript object as the 2nd parameter to the axios.post() function, Axios will automatically serialize the object to JSON for you. Axios will also set the Content-Type header to 'application/json', so web frameworks like Express can automatically parse it.*/
axios.post('http://localhost:3000/', requestBody);
axios.post('http://localhost:3000/', requestBody).then((rsp)=>{
console.log('axios.post() data: ' + rsp.data);
if(rsp.data === 'OK'){
alert('Send succeeded!');
}else{
alert('Send failed!');
}
});
//console.log('post() done.');
};