mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-11 15:35:36 -04:00
chore: Nuxt 4 upgrade (#7426)
This commit is contained in:
24
frontend/app/composables/store/use-household-store.ts
Normal file
24
frontend/app/composables/store/use-household-store.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { Composer } from "vue-i18n";
|
||||
import { useReadOnlyStore } from "../partials/use-store-factory";
|
||||
import type { HouseholdSummary } from "~/lib/api/types/household";
|
||||
import { usePublicExploreApi, useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<HouseholdSummary[]> = ref([]);
|
||||
const loading = ref(false);
|
||||
const publicLoading = ref(false);
|
||||
|
||||
export function resetHouseholdStore() {
|
||||
store.value = [];
|
||||
loading.value = false;
|
||||
publicLoading.value = false;
|
||||
}
|
||||
|
||||
export const useHouseholdStore = function (i18n?: Composer) {
|
||||
const api = useUserApi(i18n);
|
||||
return useReadOnlyStore<HouseholdSummary>("household", store, loading, api.households);
|
||||
};
|
||||
|
||||
export const usePublicHouseholdStore = function (groupSlug: string, i18n?: Composer) {
|
||||
const api = usePublicExploreApi(groupSlug, i18n).explore;
|
||||
return useReadOnlyStore<HouseholdSummary>("household-public", store, publicLoading, api.households);
|
||||
};
|
||||
Reference in New Issue
Block a user