Fix vehicle creation failing with null id#203
Conversation
|
Hi, and thanks a lot for the work. You app looks very promising, I would love to use it for sure. Is there something I'm doing wrong ? |
Strip id from payload in serializeVehiclePayload so the runtime null from the UI request body never reaches Drizzle, allowing $defaultFn to generate the UUID as intended.
3f0bf8d to
83d2304
Compare
Fixes #202
When creating a vehicle, the client sends
id: nullin the request body. Drizzle's$defaultFnonly fires when a value isundefined, not when it's explicitlynull, so the UUID was never generated and SQLite threw a NOT NULL constraint error.Fix: explicitly generate the UUID in
addVehicleinstead of relying on the schema default.