fixed spacing for json button

This commit is contained in:
Hayden 2021-01-03 10:02:02 -09:00
parent 8a99155356
commit 56a500bd82

View File

@ -18,12 +18,15 @@
@save="createRecipe" @save="createRecipe"
/> />
<VJsoneditor <div v-if="jsonEditor">
v-if="jsonEditor" <br />
v-model="recipeDetails" <br />
height="1500px" <VJsoneditor
:options="jsonEditorOptions" v-model="recipeDetails"
/> height="1500px"
:options="jsonEditorOptions"
/>
</div>
<EditRecipe v-else v-model="recipeDetails" @upload="getImage" /> <EditRecipe v-else v-model="recipeDetails" @upload="getImage" />
</v-card> </v-card>
@ -73,7 +76,6 @@ export default {
methods: { methods: {
getImage(fileObject) { getImage(fileObject) {
console.log(fileObject);
this.fileObject = fileObject; this.fileObject = fileObject;
this.onFileChange(); this.onFileChange();
}, },
@ -83,11 +85,9 @@ export default {
async createRecipe() { async createRecipe() {
this.isLoading = true; this.isLoading = true;
this.recipeDetails.image = this.fileObject.name; this.recipeDetails.image = this.fileObject.name;
console.log(this.recipeDetails);
let slug = await api.recipes.create(this.recipeDetails); let slug = await api.recipes.create(this.recipeDetails);
let response = await api.recipes.updateImage(slug, this.fileObject); await api.recipes.updateImage(slug, this.fileObject);
console.log(response);
this.isLoading = false; this.isLoading = false;
this.$router.push(`/recipe/${slug}`); this.$router.push(`/recipe/${slug}`);