mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-26 10:28:38 -06:00
adds skip to fetchMessages
This commit is contained in:
parent
8f60b802ad
commit
76d4cc27b2
@ -12,6 +12,7 @@ export class MessageQuery {
|
|||||||
where: MessageRaw;
|
where: MessageRaw;
|
||||||
limit?: number;
|
limit?: number;
|
||||||
sort?: { [key: string]: SortOrder };
|
sort?: { [key: string]: SortOrder };
|
||||||
|
skip?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MessageRepository extends Repository {
|
export class MessageRepository extends Repository {
|
||||||
@ -126,6 +127,7 @@ export class MessageRepository extends Repository {
|
|||||||
.find({ ...query.where })
|
.find({ ...query.where })
|
||||||
.select(query.select || {})
|
.select(query.select || {})
|
||||||
.sort(query?.sort ?? { messageTimestamp: -1 })
|
.sort(query?.sort ?? { messageTimestamp: -1 })
|
||||||
|
.skip(query?.skip ?? 0)
|
||||||
.limit(query?.limit ?? 0);
|
.limit(query?.limit ?? 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1256,6 +1256,7 @@ export class ChannelStartupService {
|
|||||||
owner: this.instance.name,
|
owner: this.instance.name,
|
||||||
},
|
},
|
||||||
limit: query?.limit,
|
limit: query?.limit,
|
||||||
|
skip: query?.skip,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return await this.repository.message.find(query);
|
return await this.repository.message.find(query);
|
||||||
|
Loading…
Reference in New Issue
Block a user