mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
JSDoc for sumDraftCounts
Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
This commit is contained in:
parent
212d80f4fa
commit
a5ae89fa2d
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user