Error while sending a js object to my spring boot controller ?,Displaying HTTP Request Reponse With Redux Sagaredux-thunk dispatch method fires undefined actionReact + Axios:Uncaught TypeError: Cannot read property 'type' of undefined --> something with my promise isn't adding upreact + redux - 401 - unauthorized - missing headers in Request HeadersRedux change 'state' used in other reducers when using combined reducersReactjs recieves error even when backend is showing 200 OKFacing error while doing post in my react-redux applicationdevserver add url with proxy onemoreMultipe ajax calls in parallel and dispatching redux actions after success leads to “Uncaught Error: Actions must be plain objects”Wait for redux action to finish dispatching when using redux saga
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
Science Fiction story where a man invents a machine that can help him watch history unfold
Installing PowerShell on 32-bit Kali OS fails
No idea how to draw this using tikz
Golf game boilerplate
Pronouncing Homer as in modern Greek
Why isn't KTEX's runway designation 10/28 instead of 9/27?
Books on the History of math research at European universities
Meta programming: Declare a new struct on the fly
Why is delta-v is the most useful quantity for planning space travel?
How will losing mobility of one hand affect my career as a programmer?
Is it okay / does it make sense for another player to join a running game of Munchkin?
The One-Electron Universe postulate is true - what simple change can I make to change the whole universe?
How do I repair my stair bannister?
Lifted its hind leg on or lifted its hind leg towards?
Why are all the doors on Ferenginar (the Ferengi home world) far shorter than the average Ferengi?
Why Were Madagascar and New Zealand Discovered So Late?
How to check participants in at events?
How can I successfully establish a nationwide combat training program for a large country?
How to color a zone in Tikz
Can a Gentile theist be saved?
Can the electrostatic force be infinite in magnitude?
Is a naturally all "male" species possible?
What will be the benefits of Brexit?
Error while sending a js object to my spring boot controller ?,
Displaying HTTP Request Reponse With Redux Sagaredux-thunk dispatch method fires undefined actionReact + Axios:Uncaught TypeError: Cannot read property 'type' of undefined --> something with my promise isn't adding upreact + redux - 401 - unauthorized - missing headers in Request HeadersRedux change 'state' used in other reducers when using combined reducersReactjs recieves error even when backend is showing 200 OKFacing error while doing post in my react-redux applicationdevserver add url with proxy onemoreMultipe ajax calls in parallel and dispatching redux actions after success leads to “Uncaught Error: Actions must be plain objects”Wait for redux action to finish dispatching when using redux saga
I am having a little problem, I have to write a lot of code and explain so everybody can understand, I will do that with photos, The problem I am having in general is that I get a 400 error which is a client side error, I understood that I sent a bad request so let's start by writing some code.
I have a data to send using Redux Action and saga, Here is my first method excecuted that works on event click, everything is fine so far :
addNote = () =>
let noteAdded = this.state.noteWritten;
let noteToPush =
contratId: "120120122",
texte: noteAdded,
dateAjout: "02/12/1994 19:54",
login: "Someone"
;
this.props.addNoteContrat(40000, texte: noteToPush.texte );
;
As you can see I am sending an Id with an object ( has text inside ) using method addNoteContrat, I had to send it that way because my backend work is already made and working fine. my importations are fine too.
I have a file called actions Where I create my actions :
export const addNoteContrat = (idContrat, note, success, error) =>
createAction(NOTE_CONTRAT_ADD.POST_CALL, idContrat, note, success, error );
Then I am going to watch my action using saga :
function* addNoteContrat( idContrat, note, success, error )
console.log("note :");
console.log(note);
console.log("idContrat : ");
console.log(idContrat);
const value = yield call(addContratNotes, idContrat, note);
if (value.status === 200)
yield put(setNotesContrat(value.data));
yield getNotesContrat( idContrat, success, error );
if (success) success();
else
yield put(errorNotesContrat(value.data));
if (error) error();
I get the expected result , i get my id and text in the console as expected, Then I watch :
export const watchContrat = function* watchContrat()
yield takeLatest(NOTE_CONTRAT_ADD.POST_CALL, addNoteContrat);
The I have a folder called API where I will send my data to the server, I am using an instance that uses axios, I mean you will see rather than using
axios.get(url);
I use :
myInstance.get(url);
And here is my method executed when my action get executed :
export const addContratNotes = (idContrat, note) =>
console.log("note dans API :");
console.log(note);
console.log("idContrat dans API :");
console.log(idContrat);
const endpoint = template(CONTRAT_NOTE_ADD);
return instance
.post(endpoint( note ))
.then(values => values)
.catch(err => err.response);
;
And here again I get my data right in console, But I get the error 400 in my console, which means again a bad request, as I told you already my java code is working fine using swagger.
and Finally the url I am using to send data is in my endpoints file :
export const CONTRAT_NOTE_ADD = `$CONTRAT_ENDPOINT/<%= idContrat %>/note`;
I send the Id in the url and the object in the Body request ..
I really really need help because I am stuck for about two days, I can provide any needed code for this.
Any help would be much appreciated.
reactjs redux saga
add a comment |
I am having a little problem, I have to write a lot of code and explain so everybody can understand, I will do that with photos, The problem I am having in general is that I get a 400 error which is a client side error, I understood that I sent a bad request so let's start by writing some code.
I have a data to send using Redux Action and saga, Here is my first method excecuted that works on event click, everything is fine so far :
addNote = () =>
let noteAdded = this.state.noteWritten;
let noteToPush =
contratId: "120120122",
texte: noteAdded,
dateAjout: "02/12/1994 19:54",
login: "Someone"
;
this.props.addNoteContrat(40000, texte: noteToPush.texte );
;
As you can see I am sending an Id with an object ( has text inside ) using method addNoteContrat, I had to send it that way because my backend work is already made and working fine. my importations are fine too.
I have a file called actions Where I create my actions :
export const addNoteContrat = (idContrat, note, success, error) =>
createAction(NOTE_CONTRAT_ADD.POST_CALL, idContrat, note, success, error );
Then I am going to watch my action using saga :
function* addNoteContrat( idContrat, note, success, error )
console.log("note :");
console.log(note);
console.log("idContrat : ");
console.log(idContrat);
const value = yield call(addContratNotes, idContrat, note);
if (value.status === 200)
yield put(setNotesContrat(value.data));
yield getNotesContrat( idContrat, success, error );
if (success) success();
else
yield put(errorNotesContrat(value.data));
if (error) error();
I get the expected result , i get my id and text in the console as expected, Then I watch :
export const watchContrat = function* watchContrat()
yield takeLatest(NOTE_CONTRAT_ADD.POST_CALL, addNoteContrat);
The I have a folder called API where I will send my data to the server, I am using an instance that uses axios, I mean you will see rather than using
axios.get(url);
I use :
myInstance.get(url);
And here is my method executed when my action get executed :
export const addContratNotes = (idContrat, note) =>
console.log("note dans API :");
console.log(note);
console.log("idContrat dans API :");
console.log(idContrat);
const endpoint = template(CONTRAT_NOTE_ADD);
return instance
.post(endpoint( note ))
.then(values => values)
.catch(err => err.response);
;
And here again I get my data right in console, But I get the error 400 in my console, which means again a bad request, as I told you already my java code is working fine using swagger.
and Finally the url I am using to send data is in my endpoints file :
export const CONTRAT_NOTE_ADD = `$CONTRAT_ENDPOINT/<%= idContrat %>/note`;
I send the Id in the url and the object in the Body request ..
I really really need help because I am stuck for about two days, I can provide any needed code for this.
Any help would be much appreciated.
reactjs redux saga
add a comment |
I am having a little problem, I have to write a lot of code and explain so everybody can understand, I will do that with photos, The problem I am having in general is that I get a 400 error which is a client side error, I understood that I sent a bad request so let's start by writing some code.
I have a data to send using Redux Action and saga, Here is my first method excecuted that works on event click, everything is fine so far :
addNote = () =>
let noteAdded = this.state.noteWritten;
let noteToPush =
contratId: "120120122",
texte: noteAdded,
dateAjout: "02/12/1994 19:54",
login: "Someone"
;
this.props.addNoteContrat(40000, texte: noteToPush.texte );
;
As you can see I am sending an Id with an object ( has text inside ) using method addNoteContrat, I had to send it that way because my backend work is already made and working fine. my importations are fine too.
I have a file called actions Where I create my actions :
export const addNoteContrat = (idContrat, note, success, error) =>
createAction(NOTE_CONTRAT_ADD.POST_CALL, idContrat, note, success, error );
Then I am going to watch my action using saga :
function* addNoteContrat( idContrat, note, success, error )
console.log("note :");
console.log(note);
console.log("idContrat : ");
console.log(idContrat);
const value = yield call(addContratNotes, idContrat, note);
if (value.status === 200)
yield put(setNotesContrat(value.data));
yield getNotesContrat( idContrat, success, error );
if (success) success();
else
yield put(errorNotesContrat(value.data));
if (error) error();
I get the expected result , i get my id and text in the console as expected, Then I watch :
export const watchContrat = function* watchContrat()
yield takeLatest(NOTE_CONTRAT_ADD.POST_CALL, addNoteContrat);
The I have a folder called API where I will send my data to the server, I am using an instance that uses axios, I mean you will see rather than using
axios.get(url);
I use :
myInstance.get(url);
And here is my method executed when my action get executed :
export const addContratNotes = (idContrat, note) =>
console.log("note dans API :");
console.log(note);
console.log("idContrat dans API :");
console.log(idContrat);
const endpoint = template(CONTRAT_NOTE_ADD);
return instance
.post(endpoint( note ))
.then(values => values)
.catch(err => err.response);
;
And here again I get my data right in console, But I get the error 400 in my console, which means again a bad request, as I told you already my java code is working fine using swagger.
and Finally the url I am using to send data is in my endpoints file :
export const CONTRAT_NOTE_ADD = `$CONTRAT_ENDPOINT/<%= idContrat %>/note`;
I send the Id in the url and the object in the Body request ..
I really really need help because I am stuck for about two days, I can provide any needed code for this.
Any help would be much appreciated.
reactjs redux saga
I am having a little problem, I have to write a lot of code and explain so everybody can understand, I will do that with photos, The problem I am having in general is that I get a 400 error which is a client side error, I understood that I sent a bad request so let's start by writing some code.
I have a data to send using Redux Action and saga, Here is my first method excecuted that works on event click, everything is fine so far :
addNote = () =>
let noteAdded = this.state.noteWritten;
let noteToPush =
contratId: "120120122",
texte: noteAdded,
dateAjout: "02/12/1994 19:54",
login: "Someone"
;
this.props.addNoteContrat(40000, texte: noteToPush.texte );
;
As you can see I am sending an Id with an object ( has text inside ) using method addNoteContrat, I had to send it that way because my backend work is already made and working fine. my importations are fine too.
I have a file called actions Where I create my actions :
export const addNoteContrat = (idContrat, note, success, error) =>
createAction(NOTE_CONTRAT_ADD.POST_CALL, idContrat, note, success, error );
Then I am going to watch my action using saga :
function* addNoteContrat( idContrat, note, success, error )
console.log("note :");
console.log(note);
console.log("idContrat : ");
console.log(idContrat);
const value = yield call(addContratNotes, idContrat, note);
if (value.status === 200)
yield put(setNotesContrat(value.data));
yield getNotesContrat( idContrat, success, error );
if (success) success();
else
yield put(errorNotesContrat(value.data));
if (error) error();
I get the expected result , i get my id and text in the console as expected, Then I watch :
export const watchContrat = function* watchContrat()
yield takeLatest(NOTE_CONTRAT_ADD.POST_CALL, addNoteContrat);
The I have a folder called API where I will send my data to the server, I am using an instance that uses axios, I mean you will see rather than using
axios.get(url);
I use :
myInstance.get(url);
And here is my method executed when my action get executed :
export const addContratNotes = (idContrat, note) =>
console.log("note dans API :");
console.log(note);
console.log("idContrat dans API :");
console.log(idContrat);
const endpoint = template(CONTRAT_NOTE_ADD);
return instance
.post(endpoint( note ))
.then(values => values)
.catch(err => err.response);
;
And here again I get my data right in console, But I get the error 400 in my console, which means again a bad request, as I told you already my java code is working fine using swagger.
and Finally the url I am using to send data is in my endpoints file :
export const CONTRAT_NOTE_ADD = `$CONTRAT_ENDPOINT/<%= idContrat %>/note`;
I send the Id in the url and the object in the Body request ..
I really really need help because I am stuck for about two days, I can provide any needed code for this.
Any help would be much appreciated.
reactjs redux saga
reactjs redux saga
asked Mar 21 at 14:53
TaouBenTaouBen
337110
337110
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283269%2ferror-while-sending-a-js-object-to-my-spring-boot-controller%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283269%2ferror-while-sending-a-js-object-to-my-spring-boot-controller%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown