JSDoc for sumDraftCounts

Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
This commit is contained in:
Pierre Noël 2022-10-07 15:49:53 +02:00 committed by Pierre Noël
parent 212d80f4fa
commit a5ae89fa2d

View File

@ -4,7 +4,14 @@ const { castArray } = require('lodash/fp');
const strapiUtils = require('@strapi/utils');
const { hasDraftAndPublish, isVisibleAttribute } = strapiUtils.contentTypes;
/**
* sumDraftCounts works recursively on the attributes of a model counting the
* number of draft relations
* These relations can be direct to this content type or contained within components/dynamic zones
* @param {Object} entity containing the draft relation counts
* @param {String} uid of the content type
* @returns {Number} of draft relations
*/
const sumDraftCounts = (entity, uid) => {
const model = strapi.getModel(uid);