feat: automatically remove items from stock when empty (quantity <= 0)
Build and Push Fridger Container / Build & Push Fridger Image (push) Successful in 1m16s

This commit is contained in:
2026-10-10 23:59:10 +02:00
parent 0cebd9ff75
commit 81b80d3bc5
3 changed files with 93 additions and 19 deletions
+12 -4
View File
@@ -546,9 +546,13 @@ async function confirmAndFinishAction() {
if (res.ok) {
const updated = await res.json();
playBeepSound();
showToast(`✓ ${action === 'add' ? 'Added' : 'Removed'} ${state.manage.packetCount} pack(s) of ${updated.name}`, 'success');
if (updated.deleted || updated.is_empty || updated.quantity <= 0) {
showToast(`✓ Removed empty ${updated.name} from stock`, 'success');
} else {
showToast(`✓ ${action === 'add' ? 'Added' : 'Removed'} ${state.manage.packetCount} pack(s) of ${updated.name}`, 'success');
}
// Return to manage station
// Return to manager station
resetTabletManageStation();
await loadStats();
await loadItems();
@@ -567,9 +571,13 @@ async function confirmAndFinishAction() {
if (res.ok) {
const updated = await res.json();
playBeepSound();
showToast(`✓ Set ${updated.name} to ${updated.quantity} ${updated.unit}`, 'success');
if (updated.deleted || updated.is_empty || updated.quantity <= 0) {
showToast(`✓ Finished ${updated.name} (0 ${updated.unit}): removed from stock`, 'success');
} else {
showToast(`✓ Set ${updated.name} to ${updated.quantity} ${updated.unit}`, 'success');
}
// Return to manage station
// Return to manager station
resetTabletManageStation();
await loadStats();
await loadItems();