mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-06 10:18:43 +01:00
Simplify radio CRUD code
This commit is contained in:
parent
39161fdf47
commit
5eefb265e5
6 changed files with 60 additions and 242 deletions
12
ui/src/utils/validations.js
Normal file
12
ui/src/utils/validations.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export const urlValidate = (value) => {
|
||||
if (!value) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
try {
|
||||
new URL(value)
|
||||
return undefined
|
||||
} catch (_) {
|
||||
return 'ra.validation.url'
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue