Show ya ya saved recipes
This commit is contained in:
parent
cc3f18ad70
commit
e59d4aa0ed
1 changed files with 3 additions and 1 deletions
|
|
@ -64,6 +64,7 @@ input.recipe-name {
|
|||
|
||||
<script>
|
||||
|
||||
import alert from '@/alert.js'
|
||||
import data from '@/data.js'
|
||||
import EditableIngredientsPanel from '@/components/ingredients/EditableIngredientsPanel.vue'
|
||||
|
||||
|
|
@ -121,11 +122,12 @@ export default {
|
|||
async saveRecipe() {
|
||||
const recipe = await data.saveRecipe(this.recipe);
|
||||
if (recipe?.id >= 0) {
|
||||
alert.show({ heading: 'Recipe saved', message: 'Your recipe has been saved', type: 'success' });
|
||||
this.$router.push(`/recipes/${recipe.id}`);
|
||||
return;
|
||||
}
|
||||
|
||||
alert('Failed to save recipe');
|
||||
alert.show({ heading: 'Error saving recipe', message: 'There was an error saving your recipe', type: 'error' });
|
||||
},
|
||||
async createFromScratch() {
|
||||
this.recipe = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue