Squashed commit of the following:

commit bcfe6ca707
Author: smilerz <smilerz@gmail.com>
Date:   Fri Sep 1 11:36:10 2023 -0500

    fix custom_filter exports and errors on Download link
This commit is contained in:
smilerz
2023-09-12 09:46:42 -05:00
parent 768a5ea237
commit 9e831a22df
4 changed files with 5 additions and 48 deletions

View File

@ -18,25 +18,6 @@
{{ $t("All recipes") }}
</b-form-checkbox>
<!-- <multiselect
:searchable="true"
:disabled="disabled_multiselect"
v-model="recipe_list"
:options="recipes"
:close-on-select="false"
:clear-on-select="true"
:hide-selected="true"
:preserve-search="true"
placeholder="Select Recipes"
:taggable="false"
label="name"
track-by="id"
id="id_recipes"
:multiple="true"
:loading="recipes_loading"
@search-change="searchRecipes"
>
</multiselect> -->
<generic-multiselect
class="input-group-text m-0 p-0"
@change="recipe_list = $event.val"
@ -81,10 +62,6 @@ Vue.use(BootstrapVue)
export default {
name: "ExportView",
/*mixins: [
ResolveUrlMixin,
ToastMixin,
],*/
components: { GenericMultiselect },
mixins: [ApiMixin],
data() {
@ -92,7 +69,6 @@ export default {
export_id: window.EXPORT_ID,
loading: false,
disabled_multiselect: false,
recipe_app: "DEFAULT",
recipe_list: [],
recipes_loading: false,
@ -103,7 +79,6 @@ export default {
},
mounted() {
if (this.export_id) this.insertRequested()
// else this.searchRecipes("")
},
methods: {
insertRequested: function () {
@ -118,25 +93,10 @@ export default {
this.recipe_list.push(response.data)
})
.catch((err) => {
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err)
})
// .then((e) => this.searchRecipes(""))
},
// searchRecipes: function (query) {
// this.recipes_loading = true
// this.genericAPI(this.Models.RECIPE, this.Actions.LIST, { query: query })
// .then((response) => {
// this.recipes = response.data.results
// this.recipes_loading = false
// })
// .catch((err) => {
// console.log(err)
// StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
// })
// },
exportRecipe: function () {
if (this.recipe_list.length < 1 && this.export_all == false && this.filter === undefined) {
makeToast(this.$t("Error"), this.$t("Select at least one recipe"), "danger")
@ -148,7 +108,7 @@ export default {
let formData = new FormData()
formData.append("type", this.recipe_app)
formData.append("all", this.export_all)
formData.append("filter", this.filter?.id ?? null)
formData.append("custom_filter", this.filter?.id ?? null)
for (var i = 0; i < this.recipe_list.length; i++) {
formData.append("recipes", this.recipe_list[i].id)