We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GET /api/v1/crates/:id/downloads
1 parent 2c3f180 commit a4797e8Copy full SHA for a4797e8
mirage/route-handlers/crates.js
@@ -155,6 +155,8 @@ export function register(server) {
155
server.get('/api/v1/crates/:crate_id/downloads', function(schema, request) {
156
let crateId = request.params.crate_id;
157
let crate = schema.crates.find(crateId);
158
+ if (!crate) return notFound();
159
+
160
let versionDownloads = schema.versionDownloads
161
.all()
162
.filter(it => crate.versions.indexOf(parseInt(it.version, 10)) !== -1);
0 commit comments