Icu 6657 auth method model fragments refactor (#1507)

* refactor: 💡 Remove fragment usage for arrays in auth method
* chore: 🤖 Remove ember-data-model-fragments

✅ Closes: ICU-6657
This commit is contained in:
Zhihe Li authored and GitHub committed 2022-12-02 14:29:53 -05:00
1 parent f8429b15e9
commit c3d9fd8fc5
32 files changed
+161 -341

No files matched your search

@@ -0,0 +1,16 @@
import Transform from '@ember-data/serializer/transform';
export default class AccountClaimMapArrayTransform extends Transform {
deserialize(serialized) {
const accountClaims = serialized || [];
return accountClaims.map((accountClaimString) => ({
from: accountClaimString.split('=')[0],
to: accountClaimString.split('=')[1],
}));
}
serialize(deserialized) {
const accountClaims = deserialized || [];
return accountClaims.map(({ from, to }) => `${from}=${to}`);
}
}