From 18414effd8eb1297588acd6afa0fb98d9c8dd31d Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Tue, 12 Mar 2019 17:27:06 -0400 Subject: Bug fixes and cleanup --- src/server/database.ts | 8 +------- src/server/index.ts | 6 ++---- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src/server') 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)); + res.send(JSON.stringify(user.allWorkspaceIds)); }); addSecureRoute(Method.POST, RouteStore.setActiveWorkspace, (user, req) => { -- cgit v1.2.3-70-g09d2