2020-01-16 20:01:12 +03:00
|
|
|
import Transform from '@ember-data/serializer/transform';
|
2016-09-26 16:04:20 +03:00
|
|
|
|
|
|
|
export default Transform.extend({
|
2017-08-29 06:03:45 +03:00
|
|
|
deserialize(serialized) {
|
|
|
|
let _serialized = serialized === '' ? null : serialized;
|
|
|
|
return JSON.parse(_serialized);
|
2016-09-26 16:04:20 +03:00
|
|
|
},
|
2017-08-29 06:03:45 +03:00
|
|
|
serialize(deserialized) {
|
|
|
|
return deserialized ? JSON.stringify(deserialized) : null;
|
2016-09-26 16:04:20 +03:00
|
|
|
}
|
2017-08-29 06:03:45 +03:00
|
|
|
});
|