From 8e46288f3727d17a2c5e7678cf4a4d40a83cc624 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Tue, 15 Jun 2021 09:07:32 +0100 Subject: [PATCH] Fixed JSDocs within pagination Bookshelf plugin no issue - `options` is not a correct type, so changed it to `Object` - maybe we could introduce an `options` type at some point - also fixed another case of incorrect subtype extraction from `bookshelf` --- core/server/models/plugins/pagination.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/server/models/plugins/pagination.js b/core/server/models/plugins/pagination.js index 60c6074df1..72f2cd0b19 100644 --- a/core/server/models/plugins/pagination.js +++ b/core/server/models/plugins/pagination.js @@ -35,8 +35,8 @@ paginationUtils = { /** * ### Parse Options * Take the given options and ensure they are valid pagination options, else use the defaults - * @param {options} options - * @returns {options} options sanitised for pagination + * @param {Object} options + * @returns {Object} options sanitised for pagination */ parseOptions: function parseOptions(options) { options = _.defaults(options || {}, defaults); @@ -52,8 +52,8 @@ paginationUtils = { /** * ### Query * Apply the necessary parameters to paginate the query - * @param {bookshelf.Model} model - * @param {options} options + * @param {Bookshelf['Model']} model + * @param {Object} options */ addLimitAndOffset: function addLimitAndOffset(model, options) { if (_.isNumber(options.limit)) { @@ -67,7 +67,7 @@ paginationUtils = { * ### Format Response * Takes the no. items returned and original options and calculates all of the pagination meta data * @param {Number} totalItems - * @param {options} options + * @param {Object} options * @returns {pagination} pagination metadata */ formatResponse: function formatResponse(totalItems, options) { @@ -162,7 +162,7 @@ const pagination = function pagination(bookshelf) { * 1. count query to know how many pages left (important: we don't attach any group/order statements!) * 2. the actualy fetch query with limit and page property * - * @param {options} options + * @param {Object} options * @returns {Promise} set of results + pagination metadata */ fetchPage: function fetchPage(options) {