Type the public document patient validator for production builds.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -41,7 +41,7 @@ export const Documents: CollectionConfig = {
|
||||
admin: {
|
||||
condition: (data) => !data?.isPublic,
|
||||
},
|
||||
validate: (value, { data }) => {
|
||||
validate: (value: unknown, { data }: { data?: { isPublic?: boolean | null } }) => {
|
||||
if (data?.isPublic) return true
|
||||
if (!value) return 'Укажите пациента или отметьте документ как публичный'
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user