diff --git a/frontend/src/api.js b/frontend/src/api.js index 1ca4d2f4a..b0d714754 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -5,6 +5,9 @@ import settings from "./api/settings"; import themes from "./api/themes"; import migration from "./api/migration"; import myUtils from "./api/upload"; +import category from "./api/category"; + +// import api from "../api"; export default { recipes: recipe, @@ -14,4 +17,5 @@ export default { themes: themes, migrations: migration, utils: myUtils, + categories: category, }; diff --git a/frontend/src/api/category.js b/frontend/src/api/category.js new file mode 100644 index 000000000..34af4606b --- /dev/null +++ b/frontend/src/api/category.js @@ -0,0 +1,15 @@ +import { baseURL } from "./api-utils"; +import { apiReq } from "./api-utils"; + +const categoryBase = baseURL + "category/"; + +const categoryURLs = { + get_all: `${categoryBase}all`, + }; + +export default { + async get_all() { + let response = await apiReq.get(categoryURLs.get_all); + return response; + }, +} \ No newline at end of file diff --git a/frontend/src/components/Recipe/RecipeEditor/index.vue b/frontend/src/components/Recipe/RecipeEditor/index.vue index 74b5d27d1..9a0b780ee 100644 --- a/frontend/src/components/Recipe/RecipeEditor/index.vue +++ b/frontend/src/components/Recipe/RecipeEditor/index.vue @@ -101,6 +101,10 @@ item-color="secondary" deletable-chips v-model="value.categories" + hide-selected + :items="categories" + :search-input.sync="categoriesSearchInput" + @change="categoriesSearchInput = ''" >