improved multiple warehouse stuff

This commit is contained in:
Luca Haid
2025-07-10 13:07:39 +02:00
parent 8b096a6b8c
commit 2e5cbea612
3 changed files with 14 additions and 5 deletions
@@ -1,8 +1,11 @@
async function handleApiResponse(responsePromise) {
const res = await responsePromise;
if (res.data.success === false) return window.notify('error', `Fehler: ${res.data.errors.join(', ')}`);
if (!res.data.success) {
const errors = res.data.errors;
const errorMessage = Array.isArray(errors) ? errors.join(', ') : Object.values(errors).join(', ');
return window.notify('error', `Fehler: ${errorMessage}`);
}
window.notify('success', res.data.message || 'Erfolgreich');
window.dispatchEvent(new Event('refreshTable'));
}