Do not export immutable fields

pull/7/head
semiaddict 2021-05-05 17:07:35 +02:00
parent b28f34fd32
commit ce7505532d
3 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,9 @@ module.exports = {
const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configPrefix}.${key}`);
if (shouldExclude) return;
// Do not export the _id field, as it is immutable
delete config._id;
configs[`${configPrefix}.${key}`] = { key, value: JSON.parse(value), ...config };
});

View File

@ -120,6 +120,9 @@ module.exports = {
// Check if the config should be excluded.
const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configPrefix}.${config.type}`);
if (shouldExclude) return;
// Do not export the _id field, as it is immutable
delete config._id;
configs[`${configPrefix}.${config.type}`] = config;
});

View File

@ -89,6 +89,9 @@ module.exports = {
// Check if the config should be excluded.
const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configPrefix}.${config.id}`);
if (shouldExclude) return;
// Do not export the _id field, as it is immutable
delete config._id;
configs[`${configPrefix}.${config.id}`] = config;
});