mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 13:35:23 +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
|
@ -64,12 +64,12 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, onMounted, useContext } from "@nuxtjs/composition-api";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { UserOut } from "~/types/api-types/user";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
|
||||
const { i18n } = useContext();
|
||||
|
||||
|
|
|
@ -96,8 +96,8 @@
|
|||
import { defineComponent, reactive, ref, useContext } from "@nuxtjs/composition-api";
|
||||
import RecipeDataTable from "~/components/Domain/Recipe/RecipeDataTable.vue";
|
||||
import RecipeCategoryTagSelector from "~/components/Domain/Recipe/RecipeCategoryTagSelector.vue";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { useRecipes, allRecipes } from "~/composables/use-recipes";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { useRecipes, allRecipes } from "~/composables/recipes";
|
||||
import { Recipe } from "~/types/api-types/recipe";
|
||||
|
||||
const MODES = {
|
||||
|
@ -169,7 +169,7 @@ export default defineComponent({
|
|||
},
|
||||
];
|
||||
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
|
||||
function exportSelected() {
|
||||
console.log("Export Selected");
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, useContext, ref } from "@nuxtjs/composition-api";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
@ -75,7 +75,7 @@ export default defineComponent({
|
|||
return nuxtContext.$auth.user;
|
||||
});
|
||||
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
|
||||
const domNewTokenForm = ref<VForm | null>(null);
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { ref, reactive, defineComponent, computed, useContext, watch } from "@nuxtjs/composition-api";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
@ -117,7 +117,7 @@ export default defineComponent({
|
|||
|
||||
const userCopy = ref({ ...user.value });
|
||||
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
|
||||
const domUpdatePassword = ref<VForm | null>(null);
|
||||
const password = reactive({
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
<script lang="ts">
|
||||
import { computed, defineComponent, useContext, ref, toRefs, reactive } from "@nuxtjs/composition-api";
|
||||
import UserProfileLinkCard from "@/components/Domain/User/UserProfileLinkCard.vue";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { useUserApi } from "~/composables/api";
|
||||
import { validators } from "~/composables/use-validators";
|
||||
import { alert } from "~/composables/use-toast";
|
||||
|
||||
|
@ -141,7 +141,7 @@ export default defineComponent({
|
|||
|
||||
const generatedLink = ref("");
|
||||
const token = ref("");
|
||||
const api = useApiSingleton();
|
||||
const api = useUserApi();
|
||||
async function getSignupLink() {
|
||||
const { data } = await api.groups.createInvitation({ uses: 1 });
|
||||
if (data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue