0
0
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:
Gazook89
2022-11-06 13:17:39 -06:00
parent b6c09683be
commit 970d03a5e4
2 changed files with 9 additions and 1 deletions

View File

@@ -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 : [