mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 09:22:15 +00:00
api: PUT /assignments/:id/transport gains direction (outgoing|incoming)
This commit is contained in:
@@ -175,7 +175,9 @@ export class AssignmentOpsController {
|
||||
if (!this.assignments.getAssignmentForTrip(id, tripId)) {
|
||||
throw new HttpException({ error: 'Assignment not found' }, 404);
|
||||
}
|
||||
const assignment = this.assignments.setLegTransportMode(id, body.transport_mode ?? null);
|
||||
const assignment = body.direction === 'incoming'
|
||||
? this.assignments.setIncomingLegTransportMode(id, body.transport_mode ?? null)
|
||||
: this.assignments.setLegTransportMode(id, body.transport_mode ?? null);
|
||||
this.assignments.broadcast(tripId, 'assignment:updated', { assignment }, socketId);
|
||||
return { assignment };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user