Skip to content

Commit 4a72924

Browse files
committed
Ember: Add "crate" serializer
This serializer will filter `versions: null` and remove it from the hash because in our case `null` means unknown instead of empty.
1 parent 2a7dcf4 commit 4a72924

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/serializers/crate.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import DS from 'ember-data';
2+
3+
export default DS.RESTSerializer.extend({
4+
isNewSerializerAPI: true,
5+
6+
extractRelationships(modelClass, resourceHash) {
7+
if (resourceHash.versions == null) {
8+
delete resourceHash.versions;
9+
}
10+
11+
return this._super(modelClass, resourceHash);
12+
}
13+
});

0 commit comments

Comments
 (0)