next-admin
next-admin copied to clipboard
[BUG] - can't have an empty array for Prisma fields
Description
Prisma arrays technically cannot be optional, so when you don't enter values it creates an empty array. When trying to edit an entry in NextAdmin, it won't let me leave this array empty, as it requires a value. Need it to write an empty array by default. We're getting around it right now by disabling editing on this field.
Reproduction URL
cannot share
Reproduction steps
Any Prisma value with an empty array. Below is the structure we have.
model Collection {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
type CollectionType
overrides Override[]
}
enum Override {
ROTATE
AUTOCROP
DUPLICATE
}
Next router
App router
Next Admin version
7.0.1
Screenshots

Next Admin options
No response
Logs
No response
Browsers
Chrome, Safari
Hello, would it not be possible for you to add @default([]) to your field ?