diff --git a/src/services/supabase/orderGroupRepository.js b/src/services/supabase/orderGroupRepository.js index c3ccefb..87fc869 100644 --- a/src/services/supabase/orderGroupRepository.js +++ b/src/services/supabase/orderGroupRepository.js @@ -274,7 +274,7 @@ export const assignDriverToOrderGroup = async ({ const driverName = data?.assigned_driver?.name || driverId || "—"; const oldDriverName = currentGroup?.assigned_driver?.name || currentGroup?.assigned_driver_id || ""; const logPayload = driverId - { orderGroupId, action: "driver_assigned", oldValue: oldDriverName || undefined, newValue: driverName, details: { driver_id: driverId, driver_name: driverName } } + ? { orderGroupId, action: "driver_assigned", oldValue: oldDriverName || undefined, newValue: driverName, details: { driver_id: driverId, driver_name: driverName } } : { orderGroupId, action: "driver_removed", oldValue: oldDriverName, newValue: "Снят", details: { driver_name: oldDriverName } }; await logAction(logPayload).catch(() => {});