2021-08-08 20:52:44 -08:00
|
|
|
<template>
|
2021-12-10 19:48:06 -09:00
|
|
|
<v-container>
|
|
|
|
<RecipeCategoryTagToolPage v-if="categories" :items="categories" item-type="categories" />
|
2021-08-08 20:52:44 -08:00
|
|
|
</v-container>
|
|
|
|
</template>
|
2021-12-10 19:48:06 -09:00
|
|
|
|
2021-08-08 20:52:44 -08:00
|
|
|
<script lang="ts">
|
2021-12-10 19:48:06 -09:00
|
|
|
import { defineComponent, useAsync } from "@nuxtjs/composition-api";
|
|
|
|
import RecipeCategoryTagToolPage from "~/components/Domain/Recipe/RecipeCategoryTagToolPage.vue";
|
2021-11-06 11:28:47 -08:00
|
|
|
import { useUserApi } from "~/composables/api";
|
2021-08-08 20:52:44 -08:00
|
|
|
|
|
|
|
export default defineComponent({
|
2021-12-10 19:48:06 -09:00
|
|
|
components: {
|
|
|
|
RecipeCategoryTagToolPage,
|
|
|
|
},
|
2021-08-08 20:52:44 -08:00
|
|
|
setup() {
|
2021-12-10 19:48:06 -09:00
|
|
|
const userApi = useUserApi();
|
2021-08-08 20:52:44 -08:00
|
|
|
const categories = useAsync(async () => {
|
2021-12-10 19:48:06 -09:00
|
|
|
const { data } = await userApi.categories.getAll();
|
2021-09-04 20:24:32 -08:00
|
|
|
|
2021-12-10 19:48:06 -09:00
|
|
|
if (data) {
|
|
|
|
return data;
|
|
|
|
}
|
2021-09-04 20:24:32 -08:00
|
|
|
});
|
|
|
|
|
2021-10-07 09:39:47 -08:00
|
|
|
return {
|
2021-12-10 19:48:06 -09:00
|
|
|
categories,
|
2021-10-07 09:39:47 -08:00
|
|
|
};
|
|
|
|
},
|
2021-08-08 20:52:44 -08:00
|
|
|
});
|
2022-01-07 22:08:05 +01:00
|
|
|
</script>
|