Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
zackbcom
2021-01-05 12:43:33 -06:00
25 changed files with 194 additions and 76 deletions

View File

@@ -83,12 +83,19 @@ export default {
onFileChange() {
this.image = URL.createObjectURL(this.fileObject);
},
async createRecipe() {
this.isLoading = true;
this.recipeDetails.image = this.fileObject.name;
if (this.fileObject) {
this.recipeDetails.image = this.fileObject.name;
}
let slug = await api.recipes.create(this.recipeDetails);
await api.recipes.updateImage(slug, this.fileObject);
if (this.fileObject) {
await api.recipes.updateImage(slug, this.fileObject);
}
this.isLoading = false;
this.$router.push(`/recipe/${slug}`);