mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-02 22:13:11 -05:00
feat: Added Option to Import Recipe Category During Recipe Import (#6523)
Co-authored-by: Michael Genson <genson.michael@gmail.com> Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<v-form
|
||||
ref="domUrlForm"
|
||||
@submit.prevent="createFromHtmlOrJson(newRecipeData, importKeywordsAsTags, newRecipeUrl)"
|
||||
@submit.prevent="createFromHtmlOrJson(newRecipeData, importKeywordsAsTags, importCategories, newRecipeUrl)"
|
||||
>
|
||||
<div>
|
||||
<v-card-title class="headline">
|
||||
@@ -63,6 +63,12 @@
|
||||
hide-details
|
||||
:label="$t('recipe.import-original-keywords-as-tags')"
|
||||
/>
|
||||
<v-checkbox
|
||||
v-model="importCategories"
|
||||
color="primary"
|
||||
hide-details
|
||||
:label="$t('recipe.import-original-categories')"
|
||||
/>
|
||||
<v-checkbox
|
||||
v-model="stayInEditMode"
|
||||
color="primary"
|
||||
@@ -116,6 +122,7 @@ export default defineNuxtComponent({
|
||||
|
||||
const {
|
||||
importKeywordsAsTags,
|
||||
importCategories,
|
||||
stayInEditMode,
|
||||
parseRecipe,
|
||||
navigateToRecipe,
|
||||
@@ -160,7 +167,7 @@ export default defineNuxtComponent({
|
||||
}
|
||||
handleIsEditJson();
|
||||
|
||||
async function createFromHtmlOrJson(htmlOrJsonData: string | object | null, importKeywordsAsTags: boolean, url: string | null = null) {
|
||||
async function createFromHtmlOrJson(htmlOrJsonData: string | object | null, importKeywordsAsTags: boolean, importCategories: boolean, url: string | null = null) {
|
||||
if (!htmlOrJsonData) {
|
||||
return;
|
||||
}
|
||||
@@ -179,7 +186,7 @@ export default defineNuxtComponent({
|
||||
}
|
||||
|
||||
state.loading = true;
|
||||
const { response } = await api.recipes.createOneByHtmlOrJson(dataString, importKeywordsAsTags, url);
|
||||
const { response } = await api.recipes.createOneByHtmlOrJson(dataString, importKeywordsAsTags, importCategories, url);
|
||||
handleResponse(response, importKeywordsAsTags);
|
||||
}
|
||||
|
||||
@@ -188,6 +195,7 @@ export default defineNuxtComponent({
|
||||
importKeywordsAsTags,
|
||||
stayInEditMode,
|
||||
parseRecipe,
|
||||
importCategories,
|
||||
newRecipeData,
|
||||
newRecipeUrl,
|
||||
handleIsEditJson,
|
||||
|
||||
Reference in New Issue
Block a user