diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-02 03:16:39 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-02 03:16:39 +0900 |
| commit | a53edc96bec3503517daa24837def5d3ecd82624 (patch) | |
| tree | e0a1b5081c137664d87d8ffa1f49160793edabb3 /src/api/models | |
| parent | Custom validator support (diff) | |
| download | sharkey-a53edc96bec3503517daa24837def5d3ecd82624.tar.gz sharkey-a53edc96bec3503517daa24837def5d3ecd82624.tar.bz2 sharkey-a53edc96bec3503517daa24837def5d3ecd82624.zip | |
wip
Diffstat (limited to 'src/api/models')
| -rw-r--r-- | src/api/models/post.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/models/post.ts b/src/api/models/post.ts index ab29187251..baab63f991 100644 --- a/src/api/models/post.ts +++ b/src/api/models/post.ts @@ -1,3 +1,7 @@ import db from '../../db/mongodb'; export default db.get('posts') as any; // fuck type definition + +export function isValidText(text: string): boolean { + return text.length <= 1000 && text.trim() != ''; +} |