1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-23 18:53:36 +02:00

API: Always include 'has_more' field for paginated data

This commit is contained in:
Laurent Cozic 2020-11-19 16:25:32 +00:00
parent 61618fb37c
commit 30913a5d58

View File

@ -3,7 +3,7 @@ import { Pagination, PaginationOrder } from './types';
export interface ModelFeedPage {
items: any[];
has_more?: boolean;
has_more: boolean;
total?: number;
}
@ -52,9 +52,8 @@ export default async function(db: any, tableName: string, pagination: Pagination
const rows = await db.selectAll(sql, sqlParams);
const output: ModelFeedPage = { items: rows };
if (rows.length >= pagination.limit) output.has_more = true;
return output;
return {
items: rows,
has_more: rows.length >= pagination.limit,
};
}