Finding areas that are untested and need love (#4131)

* Makes InstallationRouter like others

* Adds testing for Range file requests

- Fixes issue with small requests (0-2)

* Revert "Makes InstallationRouter like others"

This reverts commit e2d2a16ebf2757db6138c7b5b33c97c56c69ead6.

* Better handling of errors in FilesRouter

* Fix incorrectness in range requests

* Better/simpler logic

* Only on mongo at it requires Gridstore

* Open file streaming to all adapters supporting it

* Improves coverage of parsers

* Ensures depreciation warning is effective

* Removes unused function

* de-duplicate logic

* Removes necessity of overriding req.params.className on subclasses routers

* Use babel-preset-env to ensure min-version compatible code

* removes dead code

* Leverage indexes in order to infer which field is duplicated upon signup

- A note mentioned that it would be possible to leverage using the indexes on username/email to infer which is duplicated

* Small nit

* Better template to match column name

* Restores original implementation for safety

* nits
This commit is contained in:
Florent Vilmart
2017-09-05 17:51:11 -04:00
committed by GitHub
parent 3079270b3e
commit 139b9e1cb3
18 changed files with 473 additions and 272 deletions

View File

@@ -4,26 +4,13 @@ import ClassesRouter from './ClassesRouter';
import rest from '../rest';
export class InstallationsRouter extends ClassesRouter {
className() {
return '_Installation';
}
handleFind(req) {
const body = Object.assign(req.body, ClassesRouter.JSONFromQuery(req.query));
var options = {};
if (body.skip) {
options.skip = Number(body.skip);
}
if (body.limit || body.limit === 0) {
options.limit = Number(body.limit);
}
if (body.order) {
options.order = String(body.order);
}
if (body.count) {
options.count = true;
}
if (body.include) {
options.include = String(body.include);
}
const options = ClassesRouter.optionsFromBody(body);
return rest.find(req.config, req.auth,
'_Installation', body.where, options, req.info.clientSDK)
.then((response) => {
@@ -31,26 +18,6 @@ export class InstallationsRouter extends ClassesRouter {
});
}
handleGet(req) {
req.params.className = '_Installation';
return super.handleGet(req);
}
handleCreate(req) {
req.params.className = '_Installation';
return super.handleCreate(req);
}
handleUpdate(req) {
req.params.className = '_Installation';
return super.handleUpdate(req);
}
handleDelete(req) {
req.params.className = '_Installation';
return super.handleDelete(req);
}
mountRoutes() {
this.route('GET','/installations', req => { return this.handleFind(req); });
this.route('GET','/installations/:objectId', req => { return this.handleGet(req); });