fix: Remove Recipes From Cookbook API (#5899)

This commit is contained in:
Michael Genson
2025-08-15 03:44:45 -05:00
committed by GitHub
parent fd966e5843
commit 1c23d855ae
31 changed files with 169 additions and 237 deletions

View File

@@ -1,18 +1,18 @@
import type { Composer } from "vue-i18n";
import { useReadOnlyStore, useStore } from "../partials/use-store-factory";
import type { RecipeCookBook } from "~/lib/api/types/cookbook";
import type { ReadCookBook } from "~/lib/api/types/cookbook";
import { usePublicExploreApi, useUserApi } from "~/composables/api";
const store: Ref<RecipeCookBook[]> = ref([]);
const store: Ref<ReadCookBook[]> = ref([]);
const loading = ref(false);
const publicLoading = ref(false);
export const useCookbookStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<RecipeCookBook>(store, loading, api.cookbooks);
return useStore<ReadCookBook>(store, loading, api.cookbooks);
};
export const usePublicCookbookStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<RecipeCookBook>(store, publicLoading, api.cookbooks);
return useReadOnlyStore<ReadCookBook>(store, publicLoading, api.cookbooks);
};