mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
fix: Cookbooks not rendering on sidebar (#5570)
This commit is contained in:
parent
181aebf424
commit
c965d12bf1
5 changed files with 34 additions and 162 deletions
17
frontend/composables/store/use-cookbook-store.ts
Normal file
17
frontend/composables/store/use-cookbook-store.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { useReadOnlyStore, useStore } from "../partials/use-store-factory";
|
||||
import type { RecipeCookBook } from "~/lib/api/types/cookbook";
|
||||
import { usePublicExploreApi, useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<RecipeCookBook[]> = ref([]);
|
||||
const loading = ref(false);
|
||||
const publicLoading = ref(false);
|
||||
|
||||
export const useCookbookStore = function () {
|
||||
const api = useUserApi();
|
||||
return useStore<RecipeCookBook>(store, loading, api.cookbooks);
|
||||
};
|
||||
|
||||
export const usePublicCookbookStore = function (groupSlug: string) {
|
||||
const api = usePublicExploreApi(groupSlug).explore;
|
||||
return useReadOnlyStore<RecipeCookBook>(store, publicLoading, api.cookbooks);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue