before calling axios.post you'll need to
concrete_cylinders.forEach(x => {
x.id = parseInt(x.id);
x.curing = parseInt(c.curing);
});
or, if you really want, you can do it like
axios.post('http://localhost:8123/samples/concrete', {
air_content: parseFloat(air_content),
compaction_method: parseInt(compaction_method),
concrete_cylinders: concrete_cylinders.map(x => {
x.id = parseInt(x.id);
x.curing = parseInt(c.curing);
return x;
});
});
Here's a version using the newer spread syntax:
const concrete_cylinders = [
{
id: '',
specimen_name: 'A',
mould_number: '',
curing: '1',
age: '7'
},
{
id: '',
specimen_name: 'A',
mould_number: '',
curing: '1',
age: '7'
},
{
id: '',
specimen_name: 'A',
mould_number: '',
curing: '1',
age: '7'
}
]
const result = concrete_cylinders.map(o => ({
...o,
...{
curing: parseInt(o.curing),
age: parseInt(o.age)
}
}));
console.log(result);
I'm using angular-nvd3 directive for making a custom line chart display counting number of guest in specific period time range as follow : current Time - 2 --> current Time : will be display as ...
I'm using angular-nvd3 directive for making a custom line chart display counting number of guest in specific period time range as follow : current Time - 2 --> current Time : will be display as ...
how to make setTimeout() work as it looks like in for-loop? like this code function hello() { for (let index = 0; index < 3; index++) { setTimeout(function () { console....
how to make setTimeout() work as it looks like in for-loop? like this code function hello() { for (let index = 0; index < 3; index++) { setTimeout(function () { console....
Promise.prototype.finally has been part of the ECMAScript specification for more than a year and gives no errors in most browsers. When used within Teams desktop app, I see "Promise.prototype....
Promise.prototype.finally has been part of the ECMAScript specification for more than a year and gives no errors in most browsers. When used within Teams desktop app, I see "Promise.prototype....
I'd like my countdown timer to show double digits, like "53:00" instead of "53:0". Not sure what's going wrong here? Thank you! function convertSeconds(s) { var min = Math.floor(s / 60); var ...
I'd like my countdown timer to show double digits, like "53:00" instead of "53:0". Not sure what's going wrong here? Thank you! function convertSeconds(s) { var min = Math.floor(s / 60); var ...