File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,20 @@ export default ApplicationSerializer.extend(CustomPrimaryKeyMixin, {
1313
1414 serialize ( ) {
1515 const json = this . _super ( ...arguments ) ;
16- delete json . data . relationships [ 'general-statistics' ] ;
17- delete json . data . relationships [ 'order-statistics' ] ;
16+
17+ const { relationships } = json . data ;
18+ // We are deleting read only relationships so that they don't
19+ // break the server. Since these relationships are not always
20+ // present, we catch and ignore the error
21+ try {
22+ delete relationships [ 'general-statistics' ] ;
23+ } catch { } // eslint-disable-line no-empty
24+ try {
25+ delete relationships [ 'order-statistics' ] ;
26+ } catch { } // eslint-disable-line no-empty
1827
1928 return json ;
29+
2030 }
2131
2232} ) ;
You can’t perform that action at this time.
0 commit comments