changed keywords to be index based.

This commit is contained in:
AquaticLava
2024-01-02 18:43:22 -07:00
parent 61b67cd37a
commit 200cacb9ac
3 changed files with 12 additions and 5 deletions

View File

@@ -227,11 +227,18 @@ export default {
async autoPlanThread(autoPlan, mealTypeIndex) {
let apiClient = new ApiApiFactory()
let keyword_ids = []
for (const index in autoPlan.keywords[mealTypeIndex]){
let keyword = autoPlan.keywords[mealTypeIndex][index]
keyword_ids.push(keyword.id)
}
let data = {
"start_date": moment(autoPlan.startDay).format("YYYY-MM-DD"),
"end_date": moment(autoPlan.endDay).format("YYYY-MM-DD"),
"meal_type_id": autoPlan.meal_types[mealTypeIndex].id,
"keywords": autoPlan.keywords[mealTypeIndex],
"keyword_ids": keyword_ids,
"servings": autoPlan.servings,
"shared": autoPlan.shared,
"addshopping": autoPlan.addshopping