mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-26 21:18:12 +00:00
validate thumbnail is URL
This commit is contained in:
@@ -12,6 +12,14 @@ module.exports = {
|
||||
thumbnail : [
|
||||
(value)=>{
|
||||
return value?.length > 256 ? 'Max URL length of 256 characters.' : null;
|
||||
},
|
||||
(value)=>{
|
||||
try {
|
||||
Boolean(new URL(value));
|
||||
return null;
|
||||
} catch (e) {
|
||||
return 'Must be a valid URL';
|
||||
}
|
||||
}
|
||||
],
|
||||
language : [
|
||||
|
||||
Reference in New Issue
Block a user