summaryrefslogtreecommitdiff
path: root/src/api/models
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-10-07 07:23:00 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-10-07 07:23:00 +0900
commit91251916ce750c8c361668fd7969e4a9dec91ee3 (patch)
treec68b2ee40e3489c25b120ec133fc6dc04945e08a /src/api/models
parent:v: (diff)
downloadsharkey-91251916ce750c8c361668fd7969e4a9dec91ee3.tar.gz
sharkey-91251916ce750c8c361668fd7969e4a9dec91ee3.tar.bz2
sharkey-91251916ce750c8c361668fd7969e4a9dec91ee3.zip
:v:
Diffstat (limited to 'src/api/models')
-rw-r--r--src/api/models/user.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/api/models/user.ts b/src/api/models/user.ts
index 4f8086d42b..08ffe4a109 100644
--- a/src/api/models/user.ts
+++ b/src/api/models/user.ts
@@ -73,3 +73,10 @@ export type IUser = {
is_suspended: boolean;
keywords: string[];
};
+
+export function init(user): IUser {
+ user._id = new mongo.ObjectID(user._id);
+ user.avatar_id = new mongo.ObjectID(user.avatar_id);
+ user.banner_id = new mongo.ObjectID(user.banner_id);
+ user.pinned_post_id = new mongo.ObjectID(user.pinned_post_id);
+}