mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 00:09:18 +00:00
do not set id to undefined (#8232)
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
e7861232d0
commit
e87af3f6c6
@ -25,14 +25,17 @@ const storeDefinition = async (definition, ORM) => {
|
||||
const defToStore = formatDefinitionToStore(definition);
|
||||
const existingDef = await getDefinitionFromStore(definition, ORM);
|
||||
|
||||
await strapi.models['core_store']
|
||||
.forge({
|
||||
id: existingDef ? existingDef.id : undefined,
|
||||
key: `model_def_${definition.uid}`,
|
||||
type: 'object',
|
||||
value: defToStore,
|
||||
})
|
||||
.save();
|
||||
const defData = {
|
||||
key: `model_def_${definition.uid}`,
|
||||
type: 'object',
|
||||
value: defToStore,
|
||||
};
|
||||
|
||||
if (existingDef) {
|
||||
return strapi.models['core_store'].forge({ id: existingDef.id }).save(defData);
|
||||
}
|
||||
|
||||
return strapi.models['core_store'].forge(defData).save();
|
||||
};
|
||||
|
||||
const didDefinitionChange = async (definition, ORM) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user