feat: bulk deletion on "Manage Data" page (#3056)

* labels bulk delete

* add foods

* bulk delete units

* add categories

* add tags

* add tools

* update translations

* fix types for text

* fix reactivity for stores

---------

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
Kuchenpirat
2024-02-04 19:55:14 +01:00
committed by GitHub
parent 67b7fb007b
commit 52c58e1dc0
11 changed files with 310 additions and 22 deletions

View File

@@ -4,7 +4,7 @@ import { usePublicExploreApi } from "../api/api-client";
import { useUserApi } from "~/composables/api";
import { IngredientFood } from "~/lib/api/types/recipe";
let foodStore: Ref<IngredientFood[] | null> | null = null;
let foodStore: Ref<IngredientFood[] | null> = ref([]);
/**
* useFoodData returns a template reactive object
@@ -39,11 +39,11 @@ export const usePublicFoodStore = function (groupSlug: string) {
const actions = {
...usePublicStoreActions(api.foods, foodStore, loading),
flushStore() {
foodStore = null;
foodStore = ref([]);
},
};
if (!foodStore) {
if (!foodStore.value) {
foodStore = actions.getAll();
}
@@ -57,7 +57,7 @@ export const useFoodStore = function () {
const actions = {
...useStoreActions(api.foods, foodStore, loading),
flushStore() {
foodStore = null;
foodStore.value = [];
},
};