Fix error when saving patrol route stops with missing notes
Correctly handle missing `notes` field for patrol route stops during creation, resolving a 500 error. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/WbUtQAg
This commit is contained in:
parent
5281861053
commit
f50d5deb60
4
.replit
4
.replit
@ -19,6 +19,10 @@ externalPort = 80
|
|||||||
localPort = 33035
|
localPort = 33035
|
||||||
externalPort = 3001
|
externalPort = 3001
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 39567
|
||||||
|
externalPort = 6000
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 41295
|
localPort = 41295
|
||||||
externalPort = 5173
|
externalPort = 5173
|
||||||
|
|||||||
@ -3729,7 +3729,6 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
siteId: stop.siteId,
|
siteId: stop.siteId,
|
||||||
sequenceOrder: index + 1,
|
sequenceOrder: index + 1,
|
||||||
estimatedArrivalTime: stop.estimatedArrivalTime || null,
|
estimatedArrivalTime: stop.estimatedArrivalTime || null,
|
||||||
notes: stop.notes || null,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await db.insert(patrolRouteStops).values(stopsData);
|
await db.insert(patrolRouteStops).values(stopsData);
|
||||||
@ -3769,7 +3768,6 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
siteId: stop.siteId,
|
siteId: stop.siteId,
|
||||||
sequenceOrder: index + 1,
|
sequenceOrder: index + 1,
|
||||||
estimatedArrivalTime: stop.estimatedArrivalTime || null,
|
estimatedArrivalTime: stop.estimatedArrivalTime || null,
|
||||||
notes: stop.notes || null,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await db.insert(patrolRouteStops).values(stopsData);
|
await db.insert(patrolRouteStops).values(stopsData);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user