Skip to content

Commit cb6c0fd

Browse files
committed
mirage/crate-owner-invitation: Sort users by id
1 parent e7980cc commit cb6c0fd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

mirage/serializers/crate-owner-invitation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export default BaseSerializer.extend({
1515
this._adjust(hash);
1616
}
1717

18+
addToIncludes.sort((a, b) => a.id - b.id);
19+
1820
return [hash, addToIncludes];
1921
},
2022

tests/mirage/me/crate-owner-invitations/list-test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
6666
},
6767
],
6868
users: [
69+
{
70+
avatar: user.avatar,
71+
id: Number(user.id),
72+
login: user.login,
73+
name: user.name,
74+
url: user.url,
75+
},
6976
{
7077
avatar: 'https://avatars1.githubusercontent.com/u/14631425?v=4',
7178
id: Number(inviter.id),
@@ -80,13 +87,6 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
8087
name: 'wycats',
8188
url: 'https://github.com/wycats',
8289
},
83-
{
84-
avatar: user.avatar,
85-
id: Number(user.id),
86-
login: user.login,
87-
name: user.name,
88-
url: user.url,
89-
},
9090
],
9191
});
9292
});

0 commit comments

Comments
 (0)