mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 05:42:40 +00:00
move validations into it's own file.
This commit is contained in:
23
client/homebrew/editor/metadataEditor/validations.js
Normal file
23
client/homebrew/editor/metadataEditor/validations.js
Normal file
@@ -0,0 +1,23 @@
|
||||
module.exports = {
|
||||
title : [
|
||||
(value)=>{
|
||||
return value?.length > 10 ? 'Max URL length of 10 characters' : null;
|
||||
}
|
||||
],
|
||||
description : [
|
||||
(value)=>{
|
||||
return value?.length > 10 ? 'Max URL length of 10 characters' : null;
|
||||
}
|
||||
],
|
||||
thumbnail : [
|
||||
(value)=>{
|
||||
return value?.length > 5 ? 'Max URL length of 5 characters' : null;
|
||||
},
|
||||
(value)=>{
|
||||
return (value ?? '')[0] !== 'W' ? 'URL must start with W' : null;
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user