diff --git a/src/adapter.ts b/src/adapter.ts index 849c0c7..4b29d02 100644 --- a/src/adapter.ts +++ b/src/adapter.ts @@ -395,7 +395,7 @@ export class SequelizeAdapter< const selected = isPresent(sequelize.attributes); if (instances) { - if (isPresent(params?.query?.$sort)) { + if (isPresent(params.query?.$sort)) { const sortedInstances: Model[] = []; const unsortedInstances: Model[] = []; @@ -453,8 +453,12 @@ export class SequelizeAdapter< sequelize: { ...params.sequelize, raw: false } }) as Model; + Object.keys(values).forEach(key => { + instance.set(key, values[key]); + }); + await instance - .update(values, sequelize) + .save(sequelize) .catch(errorHandler); if (isPresent(sequelize.include)) {