윤준석

ADD: function getting all users in database

......@@ -72,3 +72,17 @@ database.getKeywordsByUserId = async function(userId) {
return result
}
database.getAllUsers = async function() {
const users = await User.findAll({
raw: true
})
let result = []
for (let i = 0; i < users.length; i++) {
result.push(users[i].userId)
}
return result
}
\ No newline at end of file
......
......@@ -13,6 +13,7 @@ sequelize.sync({ force: false })
database.addKeyword("rtx3060", "junseok")
database.getKeywordsByUserId("junseok")
database.deleteKeyword("phobyjun", "rtx3080")
database.getAllUsers()
})
.catch((err) => {
console.log('database connection failed');
......