Kill without validation (#2089)

* remove WithoutValidation from config and push

* remove one use of WithoutValidation

* remove another WithoutValidation

* Kill WithoutValidation and skipValidation
This commit is contained in:
Drew
2016-06-26 20:50:40 -07:00
committed by Florent Vilmart
parent 147b493e23
commit e4cfe5af24
4 changed files with 18 additions and 35 deletions

View File

@@ -5,8 +5,7 @@ import * as middleware from "../middlewares";
export class GlobalConfigRouter extends PromiseRouter {
getGlobalConfig(req) {
let database = req.config.database.WithoutValidation();
return database.find('_GlobalConfig', { objectId: 1 }, { limit: 1 }).then((results) => {
return req.config.database.find('_GlobalConfig', { objectId: 1 }, { limit: 1 }).then((results) => {
if (results.length != 1) {
// If there is no config in the database - return empty config.
return { response: { params: {} } };
@@ -23,8 +22,7 @@ export class GlobalConfigRouter extends PromiseRouter {
acc[`params.${key}`] = params[key];
return acc;
}, {});
let database = req.config.database.WithoutValidation();
return database.update('_GlobalConfig', {objectId: 1}, update, {upsert: true}).then(() => ({ response: { result: true } }));
return req.config.database.update('_GlobalConfig', {objectId: 1}, update, {upsert: true}).then(() => ({ response: { result: true } }));
}
mountRoutes() {