stubbed out generic form modal

This commit is contained in:
smilerz
2021-08-27 16:48:19 -05:00
parent 30b513cb58
commit 23ecce7930
21 changed files with 278 additions and 636 deletions

View File

@@ -517,7 +517,7 @@
}
this.$http.get(url).then((response) => {
this.recipes = response.data.results;
this.recipes = this.removeDuplicates(response.data.results, recipe => recipe.id);
}).catch((err) => {
console.log("getRecipes error: ", err);
this.makeToast(gettext('Error'), gettext('There was an error loading a resource!') + err.bodyText, 'danger')
@@ -585,6 +585,11 @@
this.makeToast(gettext('Error'), gettext('There was an error loading a resource!') + err.bodyText, 'danger')
})
},
removeDuplicates: function(data, key) {
return [
...new Map(data.map(item => [key(item), item])).values()
]
},
updatePlanTypes: function () {
let promise_list = []
let i = 0