[Bug]: Checkbox value is not sent unless touched
Contact Details
No response
What happened?
Checkboxes have boolean values and therefore you expect that if it not checked (the default value) it will send the value false. However, if you don't touch the field the attribute is not sent in the form and this uses the default value or throws an error in case it doesn't have one.
Bug prevalence
Always
AdminJS dependencies version
"@adminjs/express": "^6.0.0",
"@adminjs/prisma": "^5.0.1",
"adminjs": "^7.2.1",
What browsers do you see the problem on?
No response
Relevant log output
No response
Relevant code that's giving you issues
No response
Still present. Any updates or workarounds on this thing? I explicitly set value to false of request param fields on before and after hooks for this matter.
For example
new: { isAccessible: ({ currentAdmin }) => checkPermission(currentAdmin, Banner.ADD_PERMISSION_CODENAME, Banner.CONTENT_TYPE_ID), before: request => { if (!request?.payload?.active) { request.payload.active = false; }