Simplify radio CRUD code
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export const urlValidate = (value) => {
|
||||
if (!value) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
try {
|
||||
new URL(value)
|
||||
return undefined
|
||||
} catch (_) {
|
||||
return 'ra.validation.url'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user