mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-16 19:56:32 +02:00
Improve error handling for user assignment and add detailed logging
Enhance customer order form logging and error handling for user group assignments, and include a log snippet showing production database connection details and successful login. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 31f9bd88-0285-4787-81b3-31ceeea5a08b Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/31f9bd88-0285-4787-81b3-31ceeea5a08b/Ia7Sl2G
This commit is contained in:
1 parent
c92807eb1f
commit
4d118328de
3 files changed
+218
-3
No files matched your search
@@ -122,10 +122,17 @@ export function CustomerOrderForm({
|
||||
console.log("📝 Form submission data:", data);
|
||||
console.log("🔍 Form errors:", form.formState.errors);
|
||||
console.log("✅ Form is valid:", form.formState.isValid);
|
||||
console.log("👤 User context:", {
|
||||
console.log("👤 User context DETAILED:", {
|
||||
role: user?.role,
|
||||
userGroups: user?.userGroups,
|
||||
selectedStoreId
|
||||
userGroupsLength: user?.userGroups?.length,
|
||||
userGroupsData: user?.userGroups?.map(ug => ({
|
||||
groupId: ug.groupId,
|
||||
group: ug.group,
|
||||
fullObject: ug
|
||||
})),
|
||||
selectedStoreId,
|
||||
fullUser: user
|
||||
});
|
||||
|
||||
// Validate required fields
|
||||
@@ -138,7 +145,14 @@ export function CustomerOrderForm({
|
||||
const groupId = getUserAssignedGroupId();
|
||||
|
||||
if (!groupId) {
|
||||
console.error("❌ No group available for user:", user?.role, user?.userGroups);
|
||||
console.error("❌❌❌ CRITICAL: No group available for user:", {
|
||||
role: user?.role,
|
||||
userGroups: user?.userGroups,
|
||||
userGroupsCount: user?.userGroups?.length,
|
||||
selectedStoreId,
|
||||
getUserAssignedGroupIdResult: groupId
|
||||
});
|
||||
alert("ERREUR: Votre utilisateur n'a pas de magasin assigné. Contactez l'administrateur.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user