fix: 🐛 API sends is_primary, not primary

This commit is contained in:
Randall Morey committed 2021-04-14 11:28:07 -04:00
1 parent c213ee18b2
commit deb8871060
6 files changed
+10 -9

No files matched your search

+3 -3
View File
@@ -2,8 +2,8 @@ import ApplicationSerializer from './application';
export default class AuthMethodSerializer extends ApplicationSerializer {
/**
* Sorts the array in order of "primary" such that the primary method appears
* first. The "natural" order of auth methods places primary first.
* Sorts the array in order of "is_primary" such that the primary method
* appears first. The "natural" order of auth methods places primary first.
*
* @override
* @return {object}
@@ -11,7 +11,7 @@ export default class AuthMethodSerializer extends ApplicationSerializer {
normalizeArrayResponse() {
const normalized = super.normalizeArrayResponse(...arguments);
normalized.data = normalized.data.sort((a) =>
a.attributes.primary ? -1 : 1
a.attributes.is_primary ? -1 : 1
);
return normalized;
}