mirror of
https://github.com/sim1222/misskey.git
synced 2025-07-02 17:00:07 +09:00
This commit is contained in:
@ -27,13 +27,13 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$;
|
||||
if (sinceIdErr) return rej('invalid since_id param');
|
||||
|
||||
// Get 'max_id' parameter
|
||||
const [maxId, maxIdErr] = $(params.max_id).optional.id().$;
|
||||
if (maxIdErr) return rej('invalid max_id param');
|
||||
// Get 'until_id' parameter
|
||||
const [untilId, untilIdErr] = $(params.until_id).optional.id().$;
|
||||
if (untilIdErr) return rej('invalid until_id param');
|
||||
|
||||
// Check if both of since_id and max_id is specified
|
||||
if (sinceId && maxId) {
|
||||
return rej('cannot set since_id and max_id');
|
||||
// Check if both of since_id and until_id is specified
|
||||
if (sinceId && untilId) {
|
||||
return rej('cannot set since_id and until_id');
|
||||
}
|
||||
|
||||
// Construct query
|
||||
@ -58,9 +58,9 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
query._id = {
|
||||
$gt: sinceId
|
||||
};
|
||||
} else if (maxId) {
|
||||
} else if (untilId) {
|
||||
query._id = {
|
||||
$lt: maxId
|
||||
$lt: untilId
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user