thank you!!! i never thought about checking if axios had a different implentation! :D
snobrdinrtiste
@snobrdinrtiste
Posts made by snobrdinrtiste
-
RE: react axios request ... error status 500
-
react axios request ... error status 500
here's my code:
let objconfig = {
'headers': {
'Content-Type': 'application/json'
},
'body': {
'template': { 'shortid': 'SJZLOZiSE' },
'data' : response.data
}
}return axios.post('http://14gise:5488/api/report', objconfig) .then((resp) => { this.setState({ isWebRptLoading: false }); let a = window.open(); a.document.open(); a.document.write(resp); }) .catch((error) => { console.log('axios error: ' + error); });
i keep getting an error that says Internal Server Error 500
and the response message says "could not parse report template, aren't you missing content type?"any ideas what i'm doing wrong? my header does contain content-type and everything looks right....
-
RE: {{if }} conditional statement errors
thank you
thats the conclusion i came up with and have gone a different route to customize my json data structure in my web api -
{{if }} conditional statement errors
i am looping thru a json data object and doing a if conditional statement like this
{{#each results}}
{{#if checkraceid raceID == true}}
<h3>true</h3>
{{else}}
<h4>false</h4>
{{/if}}
{{/each}}
i have a function called checkraceid like this:
function checkraceid (id) {
console.log(id);
if (id != myraceid) {
myraceid = id;
return false;
}
return true;
}
why does it always error on the {{#if}} statement?
keeps showing this error: Parse error on line 10: ...checkraceid raceID == true}} -----------------------^ Expecting 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'EQUALS' logsi even tried using {{if }} by removing the # but still error
what is the correct way to do a conditional statement like that?