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}`); const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configPrefix}.${key}`);
if (shouldExclude) return; 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 }; configs[`${configPrefix}.${key}`] = { key, value: JSON.parse(value), ...config };
}); });

View File

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

View File

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