mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
display warning if webhooks have populated relations
This commit is contained in:
parent
6d05a64089
commit
ef71bdfd20
@ -64,9 +64,16 @@ const addCreatedByRolesPopulate = (populate) => {
|
||||
* TODO V5: Make webhooks always send the same entity data.
|
||||
*/
|
||||
const isRelationsPopulateEnabled = () => {
|
||||
return strapi.config.get('admin.relations.populate', true);
|
||||
return strapi.config.get('server.webhooks.populateRelations', true);
|
||||
};
|
||||
|
||||
if (isRelationsPopulateEnabled()) {
|
||||
process.emitWarning(
|
||||
'[deprecated] Relations population in webhooks is enabled. This is not recommended for production and will degrade performance. ' +
|
||||
'Please set `server.webhooks.populateRelations` to `false` in your `config/server.js` file.'
|
||||
);
|
||||
}
|
||||
|
||||
const getCountDeepPopulate = (uid) => getDeepPopulate(uid, { countMany: true, countOne: true });
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user