aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/database.ts8
-rw-r--r--src/server/index.ts6
2 files changed, 3 insertions, 11 deletions
diff --git a/src/server/database.ts b/src/server/database.ts
index f414266e2..164bdd68a 100644
--- a/src/server/database.ts
+++ b/src/server/database.ts
@@ -19,7 +19,7 @@ export class Database {
public update(id: string, value: any, callback: () => void) {
if (this.db) {
let collection = this.db.collection('documents');
- collection.update({ _id: id }, { $set: value }, {
+ collection.updateOne({ _id: id }, { $set: value }, {
upsert: true
}, callback);
}
@@ -71,15 +71,9 @@ export class Database {
let cursor = collection.find({ _id: { "$in": ids } })
cursor.toArray((err, docs) => {
if (err) {
- console.log("Error");
console.log(err.message);
console.log(err.errmsg);
- console.log(ids);
- console.log(["afca93a8-c6bd-4b58-967e-07784c5b12c8"]);
- console.log("MAKES SENSE: " + (ids instanceof Array));
}
- console.log(typeof ids);
- console.log("DATABASE: " + docs);
fn(docs);
})
};
diff --git a/src/server/index.ts b/src/server/index.ts
index 6f6f620d8..d710ac875 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -139,9 +139,7 @@ addSecureRoute(Method.POST, RouteStore.upload, (user, req, res) => {
// anyone attempting to navigate to localhost at this port will
// first have to login
addSecureRoute(Method.GET, RouteStore.root, (user, req, res) => {
-
-}, res => {
- res.send()
+ res.redirect(RouteStore.home);
});
// YAY! SHOW THEM THEIR WORKSPACES NOW
@@ -154,7 +152,7 @@ addSecureRoute(Method.GET, RouteStore.getActiveWorkspace, (user, req, res) => {
});
addSecureRoute(Method.GET, RouteStore.getAllWorkspaces, (user, req, res) => {
- res.send(JSON.stringify(user.allWorkspaceIds as Array<String>));
+ res.send(JSON.stringify(user.allWorkspaceIds));
});
addSecureRoute(Method.POST, RouteStore.setActiveWorkspace, (user, req) => {