diff --git a/frontend/src/components/AddRecipe.vue b/frontend/src/components/AddRecipe.vue
index 301ccf9ca..da53c0e0a 100644
--- a/frontend/src/components/AddRecipe.vue
+++ b/frontend/src/components/AddRecipe.vue
@@ -8,6 +8,11 @@
+
+
+ Looks like there was an error parsing the URL. Check the log and
+ debug/last_recipe.json to see what went wrong.
+
@@ -37,6 +42,7 @@ import api from "../api";
export default {
data() {
return {
+ error: false,
fab: false,
addRecipe: false,
recipeURL: "",
@@ -47,9 +53,16 @@ export default {
methods: {
async createRecipe() {
this.processing = true;
- await api.recipes.createByURL(this.recipeURL);
+ let response = await api.recipes.createByURL(this.recipeURL);
+ if (response.status !== 201) {
+ this.error = true;
+ this.processing = false;
+ return;
+ }
+
this.addRecipe = false;
this.processing = false;
+ this.$router.push(`/recipe/${response.data}`);
},
navCreate() {