1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-26 00:29:43 +02:00

fix: Refactor Stores and Fix Missing Public Cookbooks (#5611)

Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Michael Genson 2025-07-08 08:32:18 -05:00 committed by GitHub
parent 2f19d31d1b
commit aad7dc1abd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 96 additions and 45 deletions

View file

@ -1,3 +1,4 @@
import type { Composer } from "vue-i18n";
import { useData, useReadOnlyStore, useStore } from "../partials/use-store-factory";
import type { RecipeTool } from "~/lib/api/types/recipe";
import { usePublicExploreApi, useUserApi } from "~/composables/api";
@ -20,12 +21,12 @@ export const useToolData = function () {
});
};
export const useToolStore = function () {
const api = useUserApi();
export const useToolStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<RecipeTool>(store, loading, api.tools);
};
export const usePublicToolStore = function (groupSlug: string) {
const api = usePublicExploreApi(groupSlug).explore;
export const usePublicToolStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<RecipeTool>(store, publicLoading, api.tools);
};