윤준석

ADD: function getting all keywords from database

......@@ -109,3 +109,18 @@ database.getAllUsers = async function() {
return result
}
database.getAllKeywords = async function() {
const keywords = await Keyword.findAll({
raw: true
})
let result = []
for (let i = 0; i< keywords.length; i++) {
result.push(keywords[i].keyword)
}
console.log(result)
return result
}
\ No newline at end of file
......
......@@ -15,6 +15,7 @@ sequelize.sync({ force: false })
database.deleteKeyword("phobyjun", "rtx3080")
database.getAllUsers()
database.getUsersByKeyword("rtx3060")
database.getAllKeywords()
})
.catch((err) => {
console.log('database connection failed');
......