Skip to content

Commit 5a2c209

Browse files
Misc fixes
1 parent 3858c5c commit 5a2c209

14 files changed

+1200
-433
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
@@ -598,6 +598,50 @@ paths:
598598
description: Server error
599599
schema:
600600
$ref: '#/definitions/ErrorModel'
601+
delete:
602+
tags:
603+
- Challenges
604+
description: >
605+
Delete the challenge with the provided id.
606+
Only challenges with status of "New" can be deleted.
607+
security:
608+
- bearer: []
609+
produces:
610+
- application/json
611+
parameters:
612+
- name: challengeId
613+
in: path
614+
required: true
615+
type: string
616+
format: UUID
617+
description: The id of challenge to update
618+
responses:
619+
'200':
620+
description: Deleted - The request was successful and the resource is returned.
621+
schema:
622+
$ref: '#/definitions/Challenge'
623+
'400':
624+
description: Bad request. Request parameters were invalid.
625+
schema:
626+
$ref: '#/definitions/ErrorModel'
627+
'401':
628+
description: Unauthorized. Fail to authenticate the requester.
629+
schema:
630+
$ref: '#/definitions/ErrorModel'
631+
'403':
632+
description: >
633+
Forbidden. The requester does not have the correct permission to
634+
update the challenge.
635+
schema:
636+
$ref: '#/definitions/ErrorModel'
637+
'404':
638+
description: Challenge not found
639+
schema:
640+
$ref: '#/definitions/ErrorModel'
641+
'500':
642+
description: Server error
643+
schema:
644+
$ref: '#/definitions/ErrorModel'
601645
/challenge-types:
602646
get:
603647
tags:
@@ -2426,6 +2470,9 @@ definitions:
24262470
numOfRegistrants:
24272471
type: integer
24282472
description: number of registrants
2473+
overview:
2474+
description: the overview of the challenge
2475+
type: object
24292476
created:
24302477
type: string
24312478
format: date-time
@@ -2896,6 +2943,9 @@ definitions:
28962943
numOfRegistrants:
28972944
type: integer
28982945
description: number of registrants
2946+
overview:
2947+
description: the overview of the challenge
2948+
type: object
28992949
created:
29002950
type: string
29012951
format: date-time

0 commit comments

Comments
 (0)