diff --git a/addon/serializers/localized.js b/addon/serializers/localized.js new file mode 100644 index 00000000..a4863801 --- /dev/null +++ b/addon/serializers/localized.js @@ -0,0 +1,10 @@ +import JSONAPISerializer from "@ember-data/serializer/json-api"; + +export default class ScopeSerializer extends JSONAPISerializer { + serializeAttribute(snapshot, json, key, attributes) { + super.serializeAttribute(snapshot, json, key, attributes); + if (snapshot.record.localizedFields.includes(key)) { + json.attributes[key] = snapshot.record.getUnlocalizedField(key); + } + } +} diff --git a/app/serializers/localized.js b/app/serializers/localized.js new file mode 100644 index 00000000..6221bdcb --- /dev/null +++ b/app/serializers/localized.js @@ -0,0 +1 @@ +export { default } from "ember-emeis/serializers/localized";