Toggle navigation
Toggle navigation
This project
Loading...
Sign in
송용우
/
oss-Jaksimsamil
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
JJuOn
2020-08-31 15:34:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0307dce8585bb86389d2033dcd7ea6a460f167a4
0307dce8
1 parent
f3696d62
Fix api/challenge/list to use parameter instead of query string
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
jaksimsamil-server/src/api/challenge/README.md
jaksimsamil-server/src/api/challenge/challege.ctrl.js
jaksimsamil-server/src/api/challenge/index.js
jaksimsamil-server/src/api/challenge/README.md
View file @
0307dce
...
...
@@ -20,9 +20,9 @@
"goalPerSession"
:
Number
}
```
1.
GET /api/challenge/list
?
status
1.
GET /api/challenge/list
/:
status
-
챌린지 목록 조회
-
input(
query
)
-
input(
parameter
)
```
status=(one of ["all","enrolled","progress","end"])
```
...
...
jaksimsamil-server/src/api/challenge/challege.ctrl.js
View file @
0307dce
...
...
@@ -129,12 +129,12 @@ exports.addChallenge = async (ctx) => {
};
/* GET /api/challenge/list
?
status
query string
status can be in ['all','enrolled','progress','end']
/* GET /api/challenge/list
/:
status
parameter
status can be in ['all','enrolled','progress','end']
*/
exports
.
list
=
async
(
ctx
)
=>
{
try
{
const
status
=
ctx
.
query
.
status
;
const
status
=
ctx
.
params
.
status
;
if
(
status
!==
'all'
){
const
challenges
=
await
Challenge
.
find
({
status
:
status
}).
select
(
'-_id'
);
ctx
.
body
=
challenges
;
...
...
jaksimsamil-server/src/api/challenge/index.js
View file @
0307dce
...
...
@@ -4,7 +4,7 @@ const challengeCtrl = require('./challege.ctrl');
challenge
.
post
(
"/getchallenge"
,
challengeCtrl
.
getChallenge
);
challenge
.
post
(
"/addchallenge"
,
challengeCtrl
.
addChallenge
);
challenge
.
get
(
"/list"
,
challengeCtrl
.
list
);
challenge
.
get
(
"/list
/:status
"
,
challengeCtrl
.
list
);
challenge
.
post
(
"/participate"
,
challengeCtrl
.
participate
);
module
.
exports
=
challenge
;
\ No newline at end of file
...
...
Please
register
or
login
to post a comment