Skip to content

Commit 672a1e1

Browse files
committed
mirage/version-download: Remove id from serialized responses
1 parent 2eaad15 commit 672a1e1

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

mirage/serializers/version-download.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ export default BaseSerializer.extend({
1818
_adjust(hash) {
1919
hash.version = hash.version_id;
2020
delete hash.version_id;
21+
delete hash.id;
2122
},
2223
});

tests/mirage/crates-test.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -593,24 +593,20 @@ module('Mirage | Keywords', function(hooks) {
593593
let response = await fetch('/api/v1/crates/rand/1.0.0/downloads');
594594
assert.equal(response.status, 200);
595595

596-
// TODO Remove the `id` properties from the response
597596
let responsePayload = await response.json();
598597
assert.deepEqual(responsePayload, {
599598
version_downloads: [
600599
{
601-
id: '1',
602600
date: '2020-01-13',
603601
downloads: 9380,
604602
version: '1',
605603
},
606604
{
607-
id: '2',
608605
date: '2020-01-14',
609606
downloads: 16415,
610607
version: '1',
611608
},
612609
{
613-
id: '3',
614610
date: '2020-01-15',
615611
downloads: 23450,
616612
version: '1',
@@ -903,24 +899,20 @@ module('Mirage | Keywords', function(hooks) {
903899
let response = await fetch('/api/v1/crates/rand/downloads');
904900
assert.equal(response.status, 200);
905901

906-
// TODO Remove the `id` properties from the response
907902
let responsePayload = await response.json();
908903
assert.deepEqual(responsePayload, {
909904
version_downloads: [
910905
{
911-
id: '1',
912906
date: '2020-01-13',
913907
downloads: 9380,
914908
version: '1',
915909
},
916910
{
917-
id: '2',
918911
date: '2020-01-14',
919912
downloads: 16415,
920913
version: '2',
921914
},
922915
{
923-
id: '3',
924916
date: '2020-01-15',
925917
downloads: 23450,
926918
version: '2',

0 commit comments

Comments
 (0)