Skip to content

Commit 53fedd7

Browse files
hitesh-sourcefusedhmlau
authored andcommitted
fix(sequelize): removed unnecessary condition
Signed-off-by: Hitesh Baliyan <[email protected]>
1 parent 38dad4f commit 53fedd7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

extensions/sequelize/src/sequelize/sequelize.repository.base.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,8 @@ export class SequelizeCrudRepository<
228228
const result = await this.updateAll(data, where, options);
229229
if (result.count === 0) {
230230
// as MySQL didn't provide affected rows when the values are same as what database have
231-
if (this.dataSource.config.connector === 'mysql') {
232-
const entity = await this.findById(id);
233-
if (!entity) throw new EntityNotFoundError(this.entityClass, id);
231+
if (this.dataSource.sequelizeConfig.dialect === 'mysql') {
232+
await this.findById(id);
234233
} else {
235234
throw new EntityNotFoundError(this.entityClass, id);
236235
}

0 commit comments

Comments
 (0)