fix: 🐛 API sends is_primary, not primary
This commit is contained in:
6 files changed
+10
-9
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user