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 21:52:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a1bc328c4f0a9b633b203822ba194c31aee68fc3
a1bc328c
1 parent
5dd33fbb
ADD: function getting all users in database
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
server/apis/database.js
server/app.js
server/apis/database.js
View file @
a1bc328
...
...
@@ -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
...
...
server/app.js
View file @
a1bc328
...
...
@@ -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'
);
...
...
Please
register
or
login
to post a comment