Skip to content

Commit 9824e4f

Browse files
committed
fix customer relation serialization for waypoint
1 parent 1a35da3 commit 9824e4f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

addon/serializers/waypoint.js

+10
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ export default class WaypointSerializer extends ApplicationSerializer.extend(Emb
7272
type = belongsTo.attr(`${key}_type`);
7373
}
7474

75+
// hotfix polymprohpic model types that do not exists as models like `customer-contact` `customer-vendor` should be `contact` or `vendor`
76+
if (typeof type === 'string') {
77+
if (type.startsWith('customer-')) {
78+
type = type.replace('customer-', '');
79+
}
80+
if (type.startsWith('facilitator-')) {
81+
type = type.replace('facilitator-', '');
82+
}
83+
}
84+
7585
if (!belongsTo) {
7686
json[key + '_type'] = null;
7787
} else {

0 commit comments

Comments
 (0)