mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 05:25:26 +02:00
feat: Filter Recipes By Household (and a ton of bug fixes) (#4207)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
2a6922a85c
commit
7c274de778
65 changed files with 896 additions and 590 deletions
18
frontend/composables/store/use-household-store.ts
Normal file
18
frontend/composables/store/use-household-store.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useReadOnlyStore } from "../partials/use-store-factory";
|
||||
import { 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 const useHouseholdStore = function () {
|
||||
const api = useUserApi();
|
||||
return useReadOnlyStore<HouseholdSummary>(store, loading, api.households);
|
||||
}
|
||||
|
||||
export const usePublicHouseholdStore = function (groupSlug: string) {
|
||||
const api = usePublicExploreApi(groupSlug).explore;
|
||||
return useReadOnlyStore<HouseholdSummary>(store, publicLoading, api.households);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue