Simplify radio CRUD code

This commit is contained in:
Deluan
2023-01-24 20:58:20 -05:00
committed by Deluan Quintão
parent 39161fdf47
commit 5eefb265e5
6 changed files with 59 additions and 241 deletions
+12
View File
@@ -0,0 +1,12 @@
export const urlValidate = (value) => {
if (!value) {
return undefined
}
try {
new URL(value)
return undefined
} catch (_) {
return 'ra.validation.url'
}
}