summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/channels/posts.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-29 14:48:47 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-29 14:48:47 +0900
commitbfc193d8cd9aecdb82d585e8b4e101deac60a5bb (patch)
tree8b4dac3a56cf703650c8207f9279028a8560a96b /src/server/api/endpoints/channels/posts.ts
parentresolve conflict (diff)
downloadsharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.gz
sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.bz2
sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.zip
Resolve conflicts
Diffstat (limited to 'src/server/api/endpoints/channels/posts.ts')
-rw-r--r--src/server/api/endpoints/channels/posts.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/api/endpoints/channels/posts.ts b/src/server/api/endpoints/channels/posts.ts
index d722589c20..348dbb108b 100644
--- a/src/server/api/endpoints/channels/posts.ts
+++ b/src/server/api/endpoints/channels/posts.ts
@@ -17,22 +17,22 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const [limit = 1000, limitErr] = $(params.limit).optional.number().range(1, 1000).$;
if (limitErr) return rej('invalid limit param');
- // Get 'since_id' parameter
- const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$;
- if (sinceIdErr) return rej('invalid since_id param');
+ // Get 'sinceId' parameter
+ const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$;
+ if (sinceIdErr) return rej('invalid sinceId param');
- // Get 'until_id' parameter
- const [untilId, untilIdErr] = $(params.until_id).optional.id().$;
- if (untilIdErr) return rej('invalid until_id param');
+ // Get 'untilId' parameter
+ const [untilId, untilIdErr] = $(params.untilId).optional.id().$;
+ if (untilIdErr) return rej('invalid untilId param');
- // Check if both of since_id and until_id is specified
+ // Check if both of sinceId and untilId is specified
if (sinceId && untilId) {
- return rej('cannot set since_id and until_id');
+ return rej('cannot set sinceId and untilId');
}
- // Get 'channel_id' parameter
- const [channelId, channelIdErr] = $(params.channel_id).id().$;
- if (channelIdErr) return rej('invalid channel_id param');
+ // Get 'channelId' parameter
+ const [channelId, channelIdErr] = $(params.channelId).id().$;
+ if (channelIdErr) return rej('invalid channelId param');
// Fetch channel
const channel: IChannel = await Channel.findOne({
@@ -49,7 +49,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
};
const query = {
- channel_id: channel._id
+ channelId: channel._id
} as any;
if (sinceId) {