fix: ternary syntax in assignDriver logPayload
This commit is contained in:
parent
1e0344ee34
commit
a5b9dc1153
|
|
@ -274,7 +274,7 @@ export const assignDriverToOrderGroup = async ({
|
||||||
const driverName = data?.assigned_driver?.name || driverId || "—";
|
const driverName = data?.assigned_driver?.name || driverId || "—";
|
||||||
const oldDriverName = currentGroup?.assigned_driver?.name || currentGroup?.assigned_driver_id || "";
|
const oldDriverName = currentGroup?.assigned_driver?.name || currentGroup?.assigned_driver_id || "";
|
||||||
const logPayload = driverId
|
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 } };
|
: { orderGroupId, action: "driver_removed", oldValue: oldDriverName, newValue: "Снят", details: { driver_name: oldDriverName } };
|
||||||
await logAction(logPayload).catch(() => {});
|
await logAction(logPayload).catch(() => {});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue