Skip to content

Commit

Permalink
fix: wrong order in the model structure retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 5, 2021
1 parent 3dabc03 commit 033aae2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

*
* Issue related with wrong order in the model structure retrieval for the save operation

## [0.8.2] - 2021-08-03

Expand Down
12 changes: 6 additions & 6 deletions js/data/model.js
Expand Up @@ -871,6 +871,12 @@ export class ModelStore extends Model {
// defined for the current model
if (validate) await this.validate();

// calls the complete set of event handlers for the current
// save operation, this should trigger changes in the model
if (preSave) await this.preSave();
if (preCreate) await this.preCreate();
if (preUpdate) await this.preUpdate();

// filters the values that are present in the current model
// so that only the valid ones are stored in, invalid values
// are going to be removed, note that if the operation is an
Expand All @@ -888,12 +894,6 @@ export class ModelStore extends Model {
// exception in case there's a failure
await this.verify(model);

// calls the complete set of event handlers for the current
// save operation, this should trigger changes in the model
if (preSave) await this.preSave();
if (preCreate) await this.preCreate();
if (preUpdate) await this.preUpdate();

// calls the complete set of callbacks that should be called
// before the concrete data store save operation
for (const callback of beforeCallbacks) {
Expand Down

0 comments on commit 033aae2

Please sign in to comment.