Merge pull request #7 from semiaddict/bug/immutable-fields

Do not export immutable fields
pull/23/head
Boaz Poolman 2021-05-05 22:27:22 +02:00 committed by GitHub
commit d0e02c6ead
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
});