From a53edc96bec3503517daa24837def5d3ecd82624 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Mar 2017 03:16:39 +0900 Subject: wip --- src/api/models/post.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/api/models') 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() != ''; +} -- cgit v1.2.3-freya