mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-02 02:03:20 -05:00
refactor(frontend): 🚧 Migrate Dashboard to Nuxt
Add API and Functinality for Admin Dashboard. Stills needs to clean-up. See // TODO's
This commit is contained in:
@@ -9,22 +9,26 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref } from "@nuxtjs/composition-api";
|
||||
import { defineComponent, useAsync } from "@nuxtjs/composition-api";
|
||||
import RecipeCardSection from "~/components/Domain/Recipe/RecipeCardSection.vue";
|
||||
import { useApiSingleton } from "~/composables/use-api";
|
||||
import { Recipe } from "~/types/api-types/admin";
|
||||
|
||||
export default defineComponent({
|
||||
components: { RecipeCardSection },
|
||||
setup() {
|
||||
const api = useApiSingleton();
|
||||
|
||||
const recipes = ref<Recipe[] | null>([]);
|
||||
onMounted(async () => {
|
||||
const recipes = useAsync(async () => {
|
||||
const { data } = await api.recipes.getAll();
|
||||
recipes.value = data;
|
||||
return data;
|
||||
});
|
||||
|
||||
// const recipes = ref<Recipe[] | null>([]);
|
||||
// onMounted(async () => {
|
||||
// const { data } = await api.recipes.getAll();
|
||||
// recipes.value = data;
|
||||
// });
|
||||
|
||||
return { api, recipes };
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user