fix: ternary syntax in assignDriver logPayload

This commit is contained in:
root 2026-05-28 10:18:29 +00:00
parent 1e0344ee34
commit a5b9dc1153
1 changed files with 1 additions and 1 deletions

View File

@ -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(() => {});