mirror of https://github.com/Chocobozzz/PeerTube
Fix offset/limit on some SQL queries 🤦
parent
4555697f21
commit
9a4a9b6c4e
|
@ -70,8 +70,8 @@ export class AccountVideoRateModel extends Model<AccountVideoRateModel> {
|
|||
|
||||
static listAndCountAccountUrlsByVideoId (rateType: VideoRateType, videoId: number, start: number, count: number, t?: Transaction) {
|
||||
const query = {
|
||||
start,
|
||||
count,
|
||||
offset: start,
|
||||
limit: count,
|
||||
where: {
|
||||
videoId,
|
||||
type: rateType
|
||||
|
|
|
@ -329,8 +329,8 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
|
|||
static listAndCountByVideoId (videoId: number, start: number, count: number, t?: Sequelize.Transaction, order: 'ASC' | 'DESC' = 'ASC') {
|
||||
const query = {
|
||||
order: [ [ 'createdAt', order ] ],
|
||||
start,
|
||||
count,
|
||||
offset: start,
|
||||
limit: count,
|
||||
where: {
|
||||
videoId
|
||||
},
|
||||
|
@ -343,8 +343,8 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
|
|||
static listForFeed (start: number, count: number, videoId?: number) {
|
||||
const query = {
|
||||
order: [ [ 'createdAt', 'DESC' ] ],
|
||||
start,
|
||||
count,
|
||||
offset: start,
|
||||
limit: count,
|
||||
where: {},
|
||||
include: [
|
||||
{
|
||||
|
|
|
@ -190,8 +190,8 @@ export class VideoShareModel extends Model<VideoShareModel> {
|
|||
|
||||
static listAndCountByVideoId (videoId: number, start: number, count: number, t?: Sequelize.Transaction) {
|
||||
const query = {
|
||||
start,
|
||||
count,
|
||||
offset: start,
|
||||
limit: count,
|
||||
where: {
|
||||
videoId
|
||||
},
|
||||
|
|
|
@ -138,7 +138,7 @@ describe('Test handle downs', function () {
|
|||
|
||||
await waitJobs(servers[0])
|
||||
// Wait scheduler
|
||||
await wait(3000)
|
||||
await wait(11000)
|
||||
|
||||
const res = await getFollowersListPaginationAndSort(servers[0].url, 0, 1, 'createdAt')
|
||||
expect(res.body.data).to.be.an('array')
|
||||
|
|
Loading…
Reference in New Issue