Skip to content

Commit

Permalink
Fixed querying model masters with s at the end (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
DubrovinPavel committed Nov 1, 2023
1 parent e557abd commit 0ebfdcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Fixed
- Update model in store after batchUpdate.
- Querying models with `s` at the end.

## [3.10.0] - 2023-08-22
### Changed
Expand Down
4 changes: 4 additions & 0 deletions addon/serializers/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ export default DS.RESTSerializer.extend({
@return {String}
*/
modelNameFromPayloadKey(key) {
if (key.startsWith('#.')) {
return dasherize(key.replace(/[#\.]/g, ''));
}

return odataSingularize(dasherize(key.replace(/[#\.]/g, '')));
},

Expand Down

0 comments on commit 0ebfdcc

Please sign in to comment.