Skip to content

Commit f237685

Browse files
authored
Merge pull request #341 from topcoder-platform/features/misc-fixes
Misc fixes
2 parents 1491be0 + 16f254f commit f237685

13 files changed

+784
-17
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,19 @@ There are two parts need to be updated for local development
110110
- https://github.com/topcoder-platform/challenge-api/blob/develop/config/default.js#L27-L28
111111
Two aws config should be uncommented
112112

113+
and AUTH0 related configuration must be set at config file or in env variables.
113114

115+
### Deploy the app
116+
117+
- Follow the Notes section above
114118
- Install dependencies `npm install`
115119
- Run lint `npm run lint`
116120
- Run lint fix `npm run lint:fix`
117121
- initialize Elasticsearch, create configured Elasticsearch index if not present: `npm run init-es`,
118122
or re-create the index: `npm run init-es force`
119123
- Create tables `npm run create-tables`
120124
- Clear and init db `npm run init-db`
125+
- Seed tables: `npm run seed-tables`
121126
- Start app `npm start`
122127
- App is running at `http://localhost:3000`
123128

app-constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const DiscussionTypes = {
5555
const Topics = {
5656
ChallengeCreated: 'challenge.notification.create',
5757
ChallengeUpdated: 'challenge.notification.update',
58+
ChallengeDeleted: 'challenge.notification.delete',
5859
ChallengeTypeCreated: 'test.new.bus.events', // 'challenge.action.type.created',
5960
ChallengeTypeUpdated: 'test.new.bus.events', // 'challenge.action.type.updated',
6061
ChallengePhaseCreated: 'test.new.bus.events', // 'challenge.action.phase.created',

config/default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module.exports = {
2525
KAFKA_ERROR_TOPIC: process.env.KAFKA_ERROR_TOPIC || 'common.error.reporting',
2626

2727
AMAZON: {
28-
// AWS_ACCESS_KEY_ID: process.env.AWS_FAKE_ID,
29-
// AWS_SECRET_ACCESS_KEY: process.env.AWS_FAKE_KEY,
28+
// AWS_ACCESS_KEY_ID: process.env.AWS_FAKE_ID || "FAKE_ACCESS_KEY",
29+
// AWS_SECRET_ACCESS_KEY: process.env.AWS_FAKE_KEY || "FAKE_SECRET_ACCESS_KEY",
3030
AWS_REGION: process.env.AWS_REGION || 'ap-northeast-1',
3131
IS_LOCAL_DB: process.env.IS_LOCAL_DB || true,
3232
DYNAMODB_URL: process.env.DYNAMODB_URL || 'http://localhost:8000',

docs/swagger.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,50 @@ paths:
605605
description: Server error
606606
schema:
607607
$ref: '#/definitions/ErrorModel'
608+
delete:
609+
tags:
610+
- Challenges
611+
description: >
612+
Delete the challenge with the provided id.
613+
Only challenges with status of "New" can be deleted.
614+
security:
615+
- bearer: []
616+
produces:
617+
- application/json
618+
parameters:
619+
- name: challengeId
620+
in: path
621+
required: true
622+
type: string
623+
format: UUID
624+
description: The id of challenge to update
625+
responses:
626+
'200':
627+
description: Deleted - The request was successful and the resource is returned.
628+
schema:
629+
$ref: '#/definitions/Challenge'
630+
'400':
631+
description: Bad request. Request parameters were invalid.
632+
schema:
633+
$ref: '#/definitions/ErrorModel'
634+
'401':
635+
description: Unauthorized. Fail to authenticate the requester.
636+
schema:
637+
$ref: '#/definitions/ErrorModel'
638+
'403':
639+
description: >
640+
Forbidden. The requester does not have the correct permission to
641+
update the challenge.
642+
schema:
643+
$ref: '#/definitions/ErrorModel'
644+
'404':
645+
description: Challenge not found
646+
schema:
647+
$ref: '#/definitions/ErrorModel'
648+
'500':
649+
description: Server error
650+
schema:
651+
$ref: '#/definitions/ErrorModel'
608652
/challenge-types:
609653
get:
610654
tags:
@@ -2433,6 +2477,9 @@ definitions:
24332477
numOfRegistrants:
24342478
type: integer
24352479
description: number of registrants
2480+
overview:
2481+
description: the overview of the challenge
2482+
type: object
24362483
created:
24372484
type: string
24382485
format: date-time
@@ -2903,6 +2950,9 @@ definitions:
29032950
numOfRegistrants:
29042951
type: integer
29052952
description: number of registrants
2953+
overview:
2954+
description: the overview of the challenge
2955+
type: object
29062956
created:
29072957
type: string
29082958
format: date-time

0 commit comments

Comments
 (0)