improved multiple warehouse stuff
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user