Skip to content

Commit 11b901c

Browse files
khoakhoa
authored andcommitted
closes #245 - init commit, give checkAccount[database] the correct argument
1 parent 2919eef commit 11b901c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/routes/renderRoutes.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,15 @@ const prod = () => {
3232
// If you are here because you are implementing another database, then
3333
// just add to the hashtables above! No need to touch down here.
3434
routes.database = async (req, res) => {
35+
console.log("hiaheoifhaie");
3536
const { email, userid } = req.session;
3637
const { database } = req.params;
3738
const { Accounts } = db.getModels();
38-
3939
const user = userid && (await Accounts.findOne({ where: { id: userid } }));
4040
const { username, dbPassword } = user || {};
4141
const renderData = { email, username, dbPassword, database };
4242
renderData.dbHost = prod() ? dbHost[database] : dev_dbHost[database];
43-
renderData.dbExists = username && (await checkAccount[database](user));
44-
43+
renderData.dbExists = username && (await checkAccount[database](username));
4544
res.render("tutorial", renderData);
4645
};
4746

0 commit comments

Comments
 (0)