@strapi/strapi 4.5.2 → 4.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,7 +54,7 @@ const createContentType = (uid, definition) => {
54
54
  });
55
55
  } else {
56
56
  throw new Error(
57
- `Incorrect Content Type UID "${uid}". The UID should start with api::, plugin:: or strapi::.`
57
+ `Incorrect Content Type UID "${uid}". The UID should start with api::, plugin:: or admin::.`
58
58
  );
59
59
  }
60
60
 
@@ -134,17 +134,20 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
134
134
  // TODO: wrap into transaction
135
135
  const componentData = await createComponents(uid, validData);
136
136
 
137
+ const entityData = creationPipeline(
138
+ Object.assign(omitComponentData(model, validData), componentData),
139
+ {
140
+ contentType: model,
141
+ }
142
+ );
137
143
  let entity = await db.query(uid).create({
138
144
  ...query,
139
- data: creationPipeline(Object.assign(omitComponentData(model, validData), componentData), {
140
- contentType: model,
141
- }),
145
+ data: entityData,
142
146
  });
143
147
 
144
148
  // TODO: upload the files then set the links in the entity like with compo to avoid making too many queries
145
- // FIXME: upload in components
146
149
  if (files && Object.keys(files).length > 0) {
147
- await this.uploadFiles(uid, entity, files);
150
+ await this.uploadFiles(uid, Object.assign(entityData, entity), files);
148
151
  entity = await this.findOne(uid, entity.id, wrappedParams);
149
152
  }
150
153
 
@@ -180,19 +183,22 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
180
183
 
181
184
  // TODO: wrap in transaction
182
185
  const componentData = await updateComponents(uid, entityToUpdate, validData);
186
+ const entityData = updatePipeline(
187
+ Object.assign(omitComponentData(model, validData), componentData),
188
+ {
189
+ contentType: model,
190
+ }
191
+ );
183
192
 
184
193
  let entity = await db.query(uid).update({
185
194
  ...query,
186
195
  where: { id: entityId },
187
- data: updatePipeline(Object.assign(omitComponentData(model, validData), componentData), {
188
- contentType: model,
189
- }),
196
+ data: entityData,
190
197
  });
191
198
 
192
199
  // TODO: upload the files then set the links in the entity like with compo to avoid making too many queries
193
- // FIXME: upload in components
194
200
  if (files && Object.keys(files).length > 0) {
195
- await this.uploadFiles(uid, entity, files);
201
+ await this.uploadFiles(uid, Object.assign(entityData, entity), files);
196
202
  entity = await this.findOne(uid, entity.id, wrappedParams);
197
203
  }
198
204
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/strapi",
3
- "version": "4.5.2",
3
+ "version": "4.5.3",
4
4
  "description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
5
5
  "keywords": [
6
6
  "strapi",
@@ -80,18 +80,18 @@
80
80
  "dependencies": {
81
81
  "@koa/cors": "3.4.3",
82
82
  "@koa/router": "10.1.1",
83
- "@strapi/admin": "4.5.2",
84
- "@strapi/database": "4.5.2",
85
- "@strapi/generate-new": "4.5.2",
86
- "@strapi/generators": "4.5.2",
87
- "@strapi/logger": "4.5.2",
88
- "@strapi/permissions": "4.5.2",
89
- "@strapi/plugin-content-manager": "4.5.2",
90
- "@strapi/plugin-content-type-builder": "4.5.2",
91
- "@strapi/plugin-email": "4.5.2",
92
- "@strapi/plugin-upload": "4.5.2",
93
- "@strapi/typescript-utils": "4.5.2",
94
- "@strapi/utils": "4.5.2",
83
+ "@strapi/admin": "4.5.3",
84
+ "@strapi/database": "4.5.3",
85
+ "@strapi/generate-new": "4.5.3",
86
+ "@strapi/generators": "4.5.3",
87
+ "@strapi/logger": "4.5.3",
88
+ "@strapi/permissions": "4.5.3",
89
+ "@strapi/plugin-content-manager": "4.5.3",
90
+ "@strapi/plugin-content-type-builder": "4.5.3",
91
+ "@strapi/plugin-email": "4.5.3",
92
+ "@strapi/plugin-upload": "4.5.3",
93
+ "@strapi/typescript-utils": "4.5.3",
94
+ "@strapi/utils": "4.5.3",
95
95
  "bcryptjs": "2.4.3",
96
96
  "boxen": "5.1.2",
97
97
  "chalk": "4.1.2",
@@ -140,5 +140,5 @@
140
140
  "node": ">=14.19.1 <=18.x.x",
141
141
  "npm": ">=6.0.0"
142
142
  },
143
- "gitHead": "bcb1b7f472aae2556a9b59d59ee66d241c497a3e"
143
+ "gitHead": "5453885f7aa329f98d047a6030a8e98ba3cbdb41"
144
144
  }