Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DubrovinPavel committed Nov 1, 2023
1 parent 3ae5255 commit 9465c67
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addon/adapters/odata.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export default DS.RESTAdapter.extend({
@method batchUpdate
@param {DS.Store} store The store.
@param {DS.Model[]|DS.Model} models Is array of models or single model for batch update.
@param {Object} getProjections Optional projections for updated models.
@param {Object} getProjections Optional projections for updated models.
@return {Promise} A promise that fulfilled with an array of models in the new state.
*/
batchUpdate(store, models, getProjections = {}) {
Expand Down Expand Up @@ -580,11 +580,11 @@ export default DS.RESTAdapter.extend({
} else if (modelDirtyType === 'created' || modelDirtyType === 'updated' || model.hasChangedBelongsTo()) {
const { response } = getResponses.shift();
if (this.isSuccess(response.meta.status)) {
const internalModel = model._internalModel;
internalModel.adapterWillCommit();
internalModel.flushChangedAttributes();
const modelName = model.constructor.modelName;
run(() => {
const internalModel = model._internalModel;
internalModel.adapterWillCommit();
internalModel.flushChangedAttributes();
const modelName = model.constructor.modelName;
const normalized = store.normalize(modelName, response.body);
store.didSaveRecord(internalModel, normalized);
});
Expand Down

0 comments on commit 9465c67

Please sign in to comment.