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
commit 52c58e1dc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 310 additions and 22 deletions

View file

@ -3,7 +3,7 @@ import { useStoreActions } from "../partials/use-actions-factory";
import { MultiPurposeLabelOut } from "~/lib/api/types/labels";
import { useUserApi } from "~/composables/api";
let labelStore: Ref<MultiPurposeLabelOut[] | null> | null = null;
let labelStore: Ref<MultiPurposeLabelOut[] | null> = ref([]);
export function useLabelData() {
const data = reactive({
@ -33,11 +33,11 @@ export function useLabelStore() {
const actions = {
...useStoreActions<MultiPurposeLabelOut>(api.multiPurposeLabels, labelStore, loading),
flushStore() {
labelStore = null;
labelStore.value =[];
},
};
if (!labelStore) {
if (!labelStore.value) {
labelStore = actions.getAll();
}