summaryrefslogtreecommitdiff
path: root/src/api/models/post.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/models/post.ts')
-rw-r--r--src/api/models/post.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/api/models/post.ts b/src/api/models/post.ts
index baab63f991..8b9f7f5ef6 100644
--- a/src/api/models/post.ts
+++ b/src/api/models/post.ts
@@ -1,3 +1,5 @@
+import * as mongo from 'mongodb';
+
import db from '../../db/mongodb';
export default db.get('posts') as any; // fuck type definition
@@ -5,3 +7,15 @@ export default db.get('posts') as any; // fuck type definition
export function isValidText(text: string): boolean {
return text.length <= 1000 && text.trim() != '';
}
+
+export type IPost = {
+ _id: mongo.ObjectID;
+ created_at: Date;
+ media_ids: mongo.ObjectID[];
+ reply_to_id: mongo.ObjectID;
+ repost_id: mongo.ObjectID;
+ poll: {}; // todo
+ text: string;
+ user_id: mongo.ObjectID;
+ app_id: mongo.ObjectID;
+};