Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박시진
/
mamuri-bot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
윤준석
2022-05-24 22:01:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a79debcf2385b5187e727277cbb1a7fad41e6677
a79debcf
1 parent
ee273d23
ADD: function getting all keywords from database
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
server/apis/database.js
server/app.js
server/apis/database.js
View file @
a79debc
...
...
@@ -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
...
...
server/app.js
View file @
a79debc
...
...
@@ -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'
);
...
...
Please
register
or
login
to post a comment