@strapi/database 5.54.0 → 5.55.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity-manager/index.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAsB,MAAM,SAAS,CAAC;AAE5D,cAAc,SAAS,CAAC;AA4OxB,eAAO,MAAM,mBAAmB,GAAI,IAAI,QAAQ,KAAG,aA4+ClD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entity-manager/index.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAsB,MAAM,SAAS,CAAC;AAE5D,cAAc,SAAS,CAAC;AA4OxB,eAAO,MAAM,mBAAmB,GAAI,IAAI,QAAQ,KAAG,aA6+ClD,CAAC"}
@@ -344,12 +344,19 @@ const createEntityManager = (db)=>{
344
344
  params
345
345
  });
346
346
  const metadata = db.metadata.get(uid);
347
- const { where, data } = params;
347
+ const { data } = params;
348
348
  const dataToUpdate = processData(metadata, data);
349
349
  if (_.isEmpty(dataToUpdate)) {
350
350
  throw new Error('Update requires data');
351
351
  }
352
- const updatedRows = await this.createQueryBuilder(uid).where(where).update(dataToUpdate).execute();
352
+ // Same pick set as count and deleteMany. See deleteMany for why.
353
+ const updatedRows = await this.createQueryBuilder(uid).init(_.pick([
354
+ '_q',
355
+ 'where',
356
+ 'filters'
357
+ ], params)).update(dataToUpdate).execute({
358
+ mapResults: false
359
+ });
353
360
  const result = {
354
361
  count: updatedRows
355
362
  };