mirror of
https://gitlab.com/etc404/software-engineering-project.git
synced 2026-05-10 20:52:58 +00:00
quantity should be number NOT A STRING
This commit is contained in:
@@ -152,11 +152,12 @@ function renumberSteps() {
|
|||||||
// Call this wherever you build your POST payload:
|
// Call this wherever you build your POST payload:
|
||||||
function getIngredients() {
|
function getIngredients() {
|
||||||
return [...ingredientContainer.querySelectorAll('.dynamic-row')].map(row => {
|
return [...ingredientContainer.querySelectorAll('.dynamic-row')].map(row => {
|
||||||
|
qtyValue = row.querySelector('.ing-qty').value.trim(); // quantity should be a number NOT A STRING
|
||||||
return {
|
return {
|
||||||
ingredient: {
|
ingredient: {
|
||||||
name: row.querySelector('.ing-name').value.trim()
|
name: row.querySelector('.ing-name').value.trim()
|
||||||
},
|
},
|
||||||
quantity: row.querySelector('.ing-qty').value.trim(),
|
quantity: Number(qtyValue),
|
||||||
unit: row.querySelector('.ing-unit').value.trim(),
|
unit: row.querySelector('.ing-unit').value.trim(),
|
||||||
notes: row.querySelector('.ing-notes').value.trim()
|
notes: row.querySelector('.ing-notes').value.trim()
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user