mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 15:49:42 +02:00
Refactor/composables-folder (#787)
* move api clients and rename * organize recipes composables * rewrite useRecipeContext * refactor(frontend): ♻️ abstract common ingredient functionality. * feat(frontend): ✨ add scale, and back to recipe button + hide ingredients if none * update regex to mach 11. instead of just 1. * minor UX improvements Co-authored-by: Hayden K <hay-kot@pm.me>
This commit is contained in:
parent
095d3bda3f
commit
788e176b16
68 changed files with 330 additions and 245 deletions
|
@ -1,13 +1,13 @@
|
|||
import { useAsync, ref, reactive, Ref } from "@nuxtjs/composition-api";
|
||||
import { useAsyncKey } from "./use-utils";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { CookBook } from "~/api/class-interfaces/group-cookbooks";
|
||||
|
||||
let cookbookStore: Ref<CookBook[] | null> | null = null;
|
||||
|
||||
export const useCookbook = function () {
|
||||
function getOne(id: string | number) {
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
|
||||
const units = useAsync(async () => {
|
||||
const { data } = await api.cookbooks.getOne(id);
|
||||
|
@ -22,7 +22,7 @@ export const useCookbook = function () {
|
|||
};
|
||||
|
||||
export const useCookbooks = function () {
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
const loading = ref(false);
|
||||
const deleteTargetId = ref(0);
|
||||
const validForm = ref(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue