Also unpacks the value of username before passing it to searchHistory.

This commit is contained in:
2018-03-08 10:33:04 +01:00
parent 127db8b2fe
commit 8fbd0eb9d8

View File

@@ -10,8 +10,9 @@ const searchHistory = new SearchHistory();
*/
function historyController(req, res) {
const user = req.loggedInUser;
const username = user == undefined ? undefined : user.username;
searchHistory.read(user)
searchHistory.read(username)
.then((searchQueries) => {
res.send({ success: true, searchQueries });
})