-
-
Notifications
You must be signed in to change notification settings - Fork 122
Closed
Labels
Milestone
Description
Description and expected behavior
When implementing model-level validation and running UPDATE
actions, Zenstack doesn't pass non-existent properties.
Since a property isn't mutated when its not passed, it should not invalidate the action.
Screenshots
model Counter {
id String @id
name String
value Int
@@validate(value >= 0)
}
const client = new PrismaClient();
const counter = await client.counter.create({
data: { id: "1", name: "It should create", value: 1 }
})
//! This query fails validation
const updated = await client.counter.update({
where: { id: "1" },
data: { name: "It should update" }
})
Environment (please complete the following information):
- ZenStack version: latest
- Prisma version: latest
- Database type: Postgresql