mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
feat: Migrate to Nuxt 3 framework (#5184)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com> Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
89ab7fac25
commit
c24d532608
403 changed files with 23959 additions and 19557 deletions
|
@ -1,6 +1,5 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useData, useReadOnlyStore, useStore } from "../partials/use-store-factory";
|
||||
import { RecipeCategory } from "~/lib/api/types/recipe";
|
||||
import type { RecipeCategory } from "~/lib/api/types/recipe";
|
||||
import { usePublicExploreApi, useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<RecipeCategory[]> = ref([]);
|
||||
|
@ -13,14 +12,14 @@ export const useCategoryData = function () {
|
|||
name: "",
|
||||
slug: "",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const useCategoryStore = function () {
|
||||
const api = useUserApi();
|
||||
return useStore<RecipeCategory>(store, loading, api.categories);
|
||||
}
|
||||
};
|
||||
|
||||
export const usePublicCategoryStore = function (groupSlug: string) {
|
||||
const api = usePublicExploreApi(groupSlug).explore;
|
||||
return useReadOnlyStore<RecipeCategory>(store, publicLoading, api.categories);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useData, useReadOnlyStore, useStore } from "../partials/use-store-factory";
|
||||
import { IngredientFood } from "~/lib/api/types/recipe";
|
||||
import type { IngredientFood } from "~/lib/api/types/recipe";
|
||||
import { usePublicExploreApi, useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<IngredientFood[]> = ref([]);
|
||||
|
@ -14,14 +13,14 @@ export const useFoodData = function () {
|
|||
description: "",
|
||||
labelId: undefined,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const useFoodStore = function () {
|
||||
const api = useUserApi();
|
||||
return useStore<IngredientFood>(store, loading, api.foods);
|
||||
}
|
||||
};
|
||||
|
||||
export const usePublicFoodStore = function (groupSlug: string) {
|
||||
const api = usePublicExploreApi(groupSlug).explore;
|
||||
return useReadOnlyStore<IngredientFood>(store, publicLoading, api.foods);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useReadOnlyStore } from "../partials/use-store-factory";
|
||||
import { HouseholdSummary } from "~/lib/api/types/household";
|
||||
import type { HouseholdSummary } from "~/lib/api/types/household";
|
||||
import { usePublicExploreApi, useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<HouseholdSummary[]> = ref([]);
|
||||
|
@ -10,9 +9,9 @@ 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);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useData, useStore } from "../partials/use-store-factory";
|
||||
import { MultiPurposeLabelOut } from "~/lib/api/types/labels";
|
||||
import type { MultiPurposeLabelOut } from "~/lib/api/types/labels";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<MultiPurposeLabelOut[]> = ref([]);
|
||||
|
@ -13,9 +12,9 @@ export const useLabelData = function () {
|
|||
name: "",
|
||||
color: "",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const useLabelStore = function () {
|
||||
const api = useUserApi();
|
||||
return useStore<MultiPurposeLabelOut>(store, loading, api.multiPurposeLabels);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useData, useReadOnlyStore, useStore } from "../partials/use-store-factory";
|
||||
import { RecipeTag } from "~/lib/api/types/recipe";
|
||||
import type { RecipeTag } from "~/lib/api/types/recipe";
|
||||
import { usePublicExploreApi, useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<RecipeTag[]> = ref([]);
|
||||
|
@ -13,14 +12,14 @@ export const useTagData = function () {
|
|||
name: "",
|
||||
slug: "",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const useTagStore = function () {
|
||||
const api = useUserApi();
|
||||
return useStore<RecipeTag>(store, loading, api.tags);
|
||||
}
|
||||
};
|
||||
|
||||
export const usePublicTagStore = function (groupSlug: string) {
|
||||
const api = usePublicExploreApi(groupSlug).explore;
|
||||
return useReadOnlyStore<RecipeTag>(store, publicLoading, api.tags);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useData, useReadOnlyStore, useStore } from "../partials/use-store-factory";
|
||||
import { RecipeTool } from "~/lib/api/types/recipe";
|
||||
import type { RecipeTool } from "~/lib/api/types/recipe";
|
||||
import { usePublicExploreApi, useUserApi } from "~/composables/api";
|
||||
|
||||
interface RecipeToolWithOnHand extends RecipeTool {
|
||||
|
@ -19,14 +18,14 @@ export const useToolData = function () {
|
|||
onHand: false,
|
||||
householdsWithTool: [],
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const useToolStore = function () {
|
||||
const api = useUserApi();
|
||||
return useStore<RecipeTool>(store, loading, api.tools);
|
||||
}
|
||||
};
|
||||
|
||||
export const usePublicToolStore = function (groupSlug: string) {
|
||||
const api = usePublicExploreApi(groupSlug).explore;
|
||||
return useReadOnlyStore<RecipeTool>(store, publicLoading, api.tools);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useData, useStore } from "../partials/use-store-factory";
|
||||
import { IngredientUnit } from "~/lib/api/types/recipe";
|
||||
import type { IngredientUnit } from "~/lib/api/types/recipe";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
|
||||
const store: Ref<IngredientUnit[]> = ref([]);
|
||||
|
@ -14,9 +13,9 @@ export const useUnitData = function () {
|
|||
abbreviation: "",
|
||||
description: "",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const useUnitStore = function () {
|
||||
const api = useUserApi();
|
||||
return useStore<IngredientUnit>(store, loading, api.units);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { ref, Ref } from "@nuxtjs/composition-api";
|
||||
import { useReadOnlyStore } from "../partials/use-store-factory";
|
||||
import { useRequests } from "../api/api-client";
|
||||
import { UserSummary } from "~/lib/api/types/user";
|
||||
import type { UserSummary } from "~/lib/api/types/user";
|
||||
import { BaseCRUDAPIReadOnly } from "~/lib/api/base/base-clients";
|
||||
|
||||
const store: Ref<UserSummary[]> = ref([]);
|
||||
|
@ -16,5 +15,5 @@ export const useUserStore = function () {
|
|||
const requests = useRequests();
|
||||
const api = new GroupUserAPIReadOnly(requests);
|
||||
|
||||
return useReadOnlyStore<UserSummary>(store, loading, api, {orderBy: "full_name"});
|
||||
}
|
||||
return useReadOnlyStore<UserSummary>(store, loading, api, { orderBy: "full_name" });
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue