summaryrefslogtreecommitdiff
path: root/src/server/api/models/channel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/models/channel.ts')
-rw-r--r--src/server/api/models/channel.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/api/models/channel.ts b/src/server/api/models/channel.ts
index 97999bd9e2..9f94c5a8d1 100644
--- a/src/server/api/models/channel.ts
+++ b/src/server/api/models/channel.ts
@@ -9,10 +9,11 @@ export default Channel;
export type IChannel = {
_id: mongo.ObjectID;
- created_at: Date;
+ createdAt: Date;
title: string;
- user_id: mongo.ObjectID;
+ userId: mongo.ObjectID;
index: number;
+ watchingCount: number;
};
/**
@@ -47,7 +48,7 @@ export const pack = (
delete _channel._id;
// Remove needless properties
- delete _channel.user_id;
+ delete _channel.userId;
// Me
const meId: mongo.ObjectID = me
@@ -61,12 +62,12 @@ export const pack = (
if (me) {
//#region Watchしているかどうか
const watch = await Watching.findOne({
- user_id: meId,
- channel_id: _channel.id,
- deleted_at: { $exists: false }
+ userId: meId,
+ channelId: _channel.id,
+ deletedAt: { $exists: false }
});
- _channel.is_watching = watch !== null;
+ _channel.isWatching = watch !== null;
//#endregion
}