fix onboarding bugs
This commit is contained in:
@@ -820,6 +820,13 @@ function ajax_request(options) {
|
|||||||
throw xhr;
|
throw xhr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// File / payload too large (nginx 413)
|
||||||
|
if (xhr?.status === 413) {
|
||||||
|
bootbox.alert('The file you selected is too large. Please use an image under 2 MB and try again.');
|
||||||
|
options.onError?.(xhr, 'payload_too_large');
|
||||||
|
throw xhr;
|
||||||
|
}
|
||||||
|
|
||||||
// Usage limit reached — show upgrade notice instead of generic error
|
// Usage limit reached — show upgrade notice instead of generic error
|
||||||
if (xhr?.status === 402) {
|
if (xhr?.status === 402) {
|
||||||
const d = xhr?.responseJSON ?? {};
|
const d = xhr?.responseJSON ?? {};
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
$answer['output'] = $wh->getWarehouseList($type, $sku, $id);
|
$answer['output'] = $wh->getWarehouseList($type, $sku, $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($answer['output'])) {
|
||||||
|
$answer['success'] = 0;
|
||||||
|
$answer['message'] = 'No warehouse found. Please go to <b>Inventory → Warehouse</b> to create your first warehouse before using this page.';
|
||||||
|
} else {
|
||||||
$answer['success'] = 1;
|
$answer['success'] = 1;
|
||||||
|
}
|
||||||
exit(json_encode($answer));
|
exit(json_encode($answer));
|
||||||
?>
|
?>
|
||||||
@@ -304,8 +304,7 @@
|
|||||||
});
|
});
|
||||||
$('#warehouse').html(option);
|
$('#warehouse').html(option);
|
||||||
|
|
||||||
// Auto-select first warehouse on page load
|
if (res.output.length > 0) {
|
||||||
if (res.output && res.output.length > 0) {
|
|
||||||
$('#warehouse').val(res.output[0].id);
|
$('#warehouse').val(res.output[0].id);
|
||||||
retrieve_overview();
|
retrieve_overview();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,11 @@
|
|||||||
|
|
||||||
$wh = new WarehouseManager($pdo2, $company_id);
|
$wh = new WarehouseManager($pdo2, $company_id);
|
||||||
$answer['output'] = $wh->getWarehouseListAll();
|
$answer['output'] = $wh->getWarehouseListAll();
|
||||||
|
if (empty($answer['output'])) {
|
||||||
|
$answer['success'] = 0;
|
||||||
|
$answer['message'] = 'No warehouse found. Please go to <b>Inventory → Warehouse</b> to create your first warehouse before using this page.';
|
||||||
|
} else {
|
||||||
$answer['success'] = 1;
|
$answer['success'] = 1;
|
||||||
|
}
|
||||||
exit(json_encode($answer));
|
exit(json_encode($answer));
|
||||||
?>
|
?>
|
||||||
@@ -23,12 +23,12 @@
|
|||||||
* 10. Return { success: 1 }.
|
* 10. Return { success: 1 }.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../session.php';
|
require '../../../session.php';
|
||||||
require '../../config.php';
|
require '../../../config.php';
|
||||||
require '../../preset.php';
|
require '../../../preset.php';
|
||||||
define('UNAUTHENTICATED_ROUTE', true);
|
define('UNAUTHENTICATED_ROUTE', true);
|
||||||
require '../../assets/utils/db_auth.php';
|
require '../../../assets/utils/db_auth.php';
|
||||||
require '../../assets/utils/classes/PasswordManager.php';
|
require '../../../assets/utils/classes/PasswordManager.php';
|
||||||
|
|
||||||
header('Content-Type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
$_SESSION['login_profile_picture'] = $db_picture;
|
$_SESSION['login_profile_picture'] = $db_picture;
|
||||||
|
|
||||||
$answer['success'] = 1;
|
$answer['success'] = 1;
|
||||||
$answer['message'] = 'Profile updated.';
|
$answer['message'] = 'Profile updated successfully.';
|
||||||
$answer['profile_picture'] = $db_picture;
|
$answer['profile_picture'] = $db_picture;
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -414,7 +414,7 @@
|
|||||||
$('#name').val(), $('#surname').val(),
|
$('#name').val(), $('#surname').val(),
|
||||||
$('#username_display').val(), $('#email').val()
|
$('#username_display').val(), $('#email').val()
|
||||||
);
|
);
|
||||||
bootbox.alert('Profile updated successfully.');
|
bootbox.alert(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user