Initial commit
This commit is contained in:
@@ -196,10 +196,28 @@
|
||||
})
|
||||
.then(result => {
|
||||
localStorage.setItem('shoppingListId', result.shoppingListId);
|
||||
alert('Einkaufsliste aktualisiert.');
|
||||
const showInfo = (msg) => {
|
||||
if (window.Swal) {
|
||||
Swal.fire({ icon: 'info', title: 'Hinweis', text: msg, timer: 1800, showConfirmButton: false });
|
||||
} else { alert(msg); }
|
||||
};
|
||||
|
||||
if (result.skippedCount && result.skippedCount > 0) {
|
||||
if (result.addedCount && result.addedCount > 0) {
|
||||
showInfo(`Einkaufsliste aktualisiert. ${result.skippedCount} Zutaten waren bereits vorhanden und wurden übersprungen.`);
|
||||
} else {
|
||||
showInfo('Diese Zutaten sind bereits in der Einkaufsliste vorhanden.');
|
||||
}
|
||||
} else {
|
||||
showInfo('Einkaufsliste aktualisiert.');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
alert('Fehler beim Aktualisieren der Einkaufsliste.');
|
||||
if (window.Swal) {
|
||||
Swal.fire({ icon: 'error', title: 'Fehler', text: 'Fehler beim Aktualisieren der Einkaufsliste.' });
|
||||
} else {
|
||||
alert('Fehler beim Aktualisieren der Einkaufsliste.');
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
id = ri.Id,
|
||||
name = ri.Ingredient.Name,
|
||||
amount = ri.Quantity,
|
||||
unit = ri.Unit.Name,
|
||||
unit = ri.Unit.Symbol,
|
||||
shoppingListId = Model.RecipeIngredientToShoppingListMap.ContainsKey(ri.Id)
|
||||
? Model.RecipeIngredientToShoppingListMap[ri.Id]
|
||||
: Guid.Empty
|
||||
@@ -104,3 +104,4 @@
|
||||
</script>
|
||||
<script src="~/js/site.js"></script>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user