Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-05-17 15:33:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b4a9755c24f79a116f51cd8205eb5b2c35123123
b4a9755c
1 parent
84c4f31c
feat. 404 error exception
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
server/src/api/bottle/bottle.ctrl.js
server/src/api/bottle/bottle.ctrl.js
View file @
b4a9755
...
...
@@ -4,6 +4,7 @@ const Hub = require('../../models/hub');
const
Medicine
=
require
(
'../../models/medicine'
);
const
Mqtt
=
require
(
'../../lib/MqttModule'
);
const
jwt
=
require
(
'jsonwebtoken'
);
const
hub
=
require
(
'../../models/hub'
);
//약병 등록
exports
.
bottleConnect
=
async
(
ctx
)
=>
{
...
...
@@ -172,13 +173,13 @@ exports.getBottleList = async(ctx) => {
const
{
userId
}
=
jwt
.
verify
(
token
,
process
.
env
.
JWT_SECRET
);
const
hubList
=
await
Hub
.
find
({
userId
})
if
(
!
hubList
)
{
if
(
!
hubList
||
!
hubList
.
length
)
{
ctx
.
status
=
404
;
return
;
}
const
bottleList
=
await
getBottleListByHub
(
hubList
);
if
(
!
bottleList
)
{
if
(
!
bottleList
||
!
bottleList
.
length
)
{
ctx
.
status
=
404
;
return
;
}
...
...
Please
register
or
login
to post a comment