Compare commits
9 Commits
main
...
bfe9f12802
| Author | SHA1 | Date | |
|---|---|---|---|
|
bfe9f12802
|
|||
|
600c7b6d25
|
|||
|
38560f744d
|
|||
|
7c1cee2f3a
|
|||
|
cd77cfdf66
|
|||
|
7b98506ad5
|
|||
|
6d708d8fd4
|
|||
|
b3d36afdc7
|
|||
|
12a02ef1f8
|
@@ -81,25 +81,17 @@ async function addRecipe() {
|
||||
console.log(comps.ings)
|
||||
|
||||
const ingredientIDs = await Promise.all(
|
||||
comps.ings.map(async it => (await client.pb.collection('ingredients').create(it)).id) // get the id of the returned record
|
||||
comps.ings.map(async it => (await client.pb.collection('ingredients').create({
|
||||
'quantity': it.quantity,
|
||||
'name': it.name,
|
||||
'unit': it.name
|
||||
})).id) // get the id of the returned record
|
||||
)
|
||||
|
||||
const stepIDs = await Promise.all(
|
||||
comps.stepList.map(async it => (await client.pb.collection('steps').create(it)).id)
|
||||
const stepIds = await Promise.all(
|
||||
|
||||
)
|
||||
|
||||
const recipe = await client.pb.collection('recipes').create({
|
||||
name: comps.name,
|
||||
description: comps.description,
|
||||
servings: comps.servings,
|
||||
worktime: comps.worktime,
|
||||
waittime: comps.waittime,
|
||||
rating: comps.rating,
|
||||
ingredients: ingredientIDs,
|
||||
steps: stepIDs
|
||||
})
|
||||
|
||||
console.log(recipe)
|
||||
}
|
||||
|
||||
function addIngredient() {
|
||||
|
||||
Reference in New Issue
Block a user