mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 02:56:10 +00:00
bac4599d64
A nullable day_assignments.stay_minutes holds the stay of one visit; a visit without one keeps reading the place's duration, so existing trips drive as before. REST PUT /trips/:tripId/assignments/:id/stay and the MCP tool set_assignment_stay write it with day_edit.
9 lines
464 B
TypeScript
9 lines
464 B
TypeScript
import { assignmentSchema, type AssignmentStayRequest } from '@trek/shared';
|
|
import { apiClient } from './client';
|
|
|
|
/** How long the drive stands at one visit (#3092); null hands it back to the place's stay. */
|
|
export async function saveAssignmentStay(tripId: number | string, id: number, body: AssignmentStayRequest) {
|
|
const saved = await apiClient.put(`/trips/${tripId}/assignments/${id}/stay`, body);
|
|
return assignmentSchema.parse(saved.data.assignment);
|
|
}
|