From 023c002b2adef00ec5a36339e8780dbaa763d746 Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Mon, 26 Jun 2023 05:48:36 +0200 Subject: [PATCH] feat(input-csv-twice): add alert to axios post callback --- input-csv-twice/app/components/csv-reader.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/input-csv-twice/app/components/csv-reader.jsx b/input-csv-twice/app/components/csv-reader.jsx index f6db57e..d928bba 100644 --- a/input-csv-twice/app/components/csv-reader.jsx +++ b/input-csv-twice/app/components/csv-reader.jsx @@ -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.'); };