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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user