feat: lazy load all news

This commit is contained in:
Jovan Krunić
2021-07-06 18:40:09 +02:00
parent 975f8e25e4
commit e48134eddc
3 changed files with 34 additions and 12 deletions

View File

@@ -29,8 +29,9 @@ export class NewsProvider {
* Get news messages
*
* @param size How many messages/news to fetch
* @param from From which (results) page to start
*/
async getList(size: number): Promise<SCMessage[]> {
async getList(size: number, from: number): Promise<SCMessage[]> {
const result = await this.dataProvider.search({
filter: {
type: 'value',
@@ -47,6 +48,7 @@ export class NewsProvider {
order: 'desc',
}],
size: size,
from: from,
});
return result.data as SCMessage[];