mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
stubbed out generic form modal
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user