Skip to content

Commit ce75055

Browse files
committed
Do not export immutable fields
1 parent b28f34f commit ce75055

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

services/core-store.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ module.exports = {
9696
const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configPrefix}.${key}`);
9797
if (shouldExclude) return;
9898

99+
// Do not export the _id field, as it is immutable
100+
delete config._id;
101+
99102
configs[`${configPrefix}.${key}`] = { key, value: JSON.parse(value), ...config };
100103
});
101104

services/role-permissions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ module.exports = {
120120
// Check if the config should be excluded.
121121
const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configPrefix}.${config.type}`);
122122
if (shouldExclude) return;
123+
124+
// Do not export the _id field, as it is immutable
125+
delete config._id;
123126

124127
configs[`${configPrefix}.${config.type}`] = config;
125128
});

services/webhooks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ module.exports = {
8989
// Check if the config should be excluded.
9090
const shouldExclude = strapi.plugins['config-sync'].config.exclude.includes(`${configPrefix}.${config.id}`);
9191
if (shouldExclude) return;
92+
93+
// Do not export the _id field, as it is immutable
94+
delete config._id;
9295

9396
configs[`${configPrefix}.${config.id}`] = config;
9497
});

0 commit comments

Comments
 (0)