Remove 'database' field from request and make all database requests go through config.

This commit is contained in:
Nikita Lutsenko
2016-02-26 21:17:04 -08:00
parent 49a4b74f7c
commit daa5f11122
3 changed files with 3 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ function clearApp(req, res) {
if (!req.auth.isMaster) {
return res.status(401).send({"error": "unauthorized"});
}
req.database.deleteEverything().then(() => {
return req.config.database.deleteEverything().then(() => {
res.status(200).send({});
});
}
@@ -42,7 +42,7 @@ function dropApp(req, res) {
if (!req.auth.isMaster) {
return res.status(401).send({"error": "unauthorized"});
}
req.database.deleteEverything().then(() => {
return req.config.database.deleteEverything().then(() => {
cache.apps.remove(req.config.applicationId);
res.status(200).send({});
});