summaryrefslogtreecommitdiff
path: root/src/api/models
diff options
context:
space:
mode:
authorこぴなたみぽ <Syuilotan@yahoo.co.jp>2017-11-01 04:18:32 +0900
committerGitHub <noreply@github.com>2017-11-01 04:18:32 +0900
commit2a00930150207c983a2f6e111d03f2db33b897b9 (patch)
treef41dc9bcc5498ac89839057e07910b9c2d81fed3 /src/api/models
parentv2752 (diff)
parentv2769 (diff)
downloadsharkey-2a00930150207c983a2f6e111d03f2db33b897b9.tar.gz
sharkey-2a00930150207c983a2f6e111d03f2db33b897b9.tar.bz2
sharkey-2a00930150207c983a2f6e111d03f2db33b897b9.zip
Merge pull request #854 from syuilo/bbs
Bbs
Diffstat (limited to 'src/api/models')
-rw-r--r--src/api/models/channel.ts14
-rw-r--r--src/api/models/post.ts1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/api/models/channel.ts b/src/api/models/channel.ts
new file mode 100644
index 0000000000..c80e84dbc8
--- /dev/null
+++ b/src/api/models/channel.ts
@@ -0,0 +1,14 @@
+import * as mongo from 'mongodb';
+import db from '../../db/mongodb';
+
+const collection = db.get('channels');
+
+export default collection as any; // fuck type definition
+
+export type IChannel = {
+ _id: mongo.ObjectID;
+ created_at: Date;
+ title: string;
+ user_id: mongo.ObjectID;
+ index: number;
+};
diff --git a/src/api/models/post.ts b/src/api/models/post.ts
index 8b9f7f5ef6..fe07dcb0b1 100644
--- a/src/api/models/post.ts
+++ b/src/api/models/post.ts
@@ -10,6 +10,7 @@ export function isValidText(text: string): boolean {
export type IPost = {
_id: mongo.ObjectID;
+ channel_id: mongo.ObjectID;
created_at: Date;
media_ids: mongo.ObjectID[];
reply_to_id: mongo.ObjectID;