|
1 | 1 | import { Response } from 'ember-cli-mirage';
|
2 | 2 |
|
3 | 3 | import { getSession } from '../utils/session';
|
4 |
| -import { compareIsoDates, compareStrings, notFound, pageParams, withMeta } from './-utils'; |
| 4 | +import { compareIsoDates, compareStrings, notFound, pageParams } from './-utils'; |
5 | 5 |
|
6 | 6 | export function list(schema, request) {
|
7 | 7 | const { start, end } = pageParams(request);
|
@@ -46,7 +46,7 @@ export function list(schema, request) {
|
46 | 46 | crates = crates.sort((a, b) => compareStrings(a.id.toLowerCase(), b.id.toLowerCase()));
|
47 | 47 | }
|
48 | 48 |
|
49 |
| - return withMeta(this.serialize(crates.slice(start, end)), { total: crates.length }); |
| 49 | + return { ...this.serialize(crates.slice(start, end)), meta: { total: crates.length } }; |
50 | 50 | }
|
51 | 51 |
|
52 | 52 | export function register(server) {
|
@@ -221,7 +221,7 @@ export function register(server) {
|
221 | 221 |
|
222 | 222 | let versionDownloads = schema.versionDownloads.all().filter(it => it.version.crateId === crate.id);
|
223 | 223 |
|
224 |
| - return withMeta(this.serialize(versionDownloads), { extra_downloads: crate._extra_downloads }); |
| 224 | + return { ...this.serialize(versionDownloads), meta: { extra_downloads: crate._extra_downloads } }; |
225 | 225 | });
|
226 | 226 |
|
227 | 227 | server.put('/api/v1/crates/:name/owners', (schema, request) => {
|
|
0 commit comments