Skip to content

Misc fixes #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,19 @@ There are two parts need to be updated for local development
- https://github.com/topcoder-platform/challenge-api/blob/develop/config/default.js#L27-L28
Two aws config should be uncommented

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

### Deploy the app

- Follow the Notes section above
- Install dependencies `npm install`
- Run lint `npm run lint`
- Run lint fix `npm run lint:fix`
- initialize Elasticsearch, create configured Elasticsearch index if not present: `npm run init-es`,
or re-create the index: `npm run init-es force`
- Create tables `npm run create-tables`
- Clear and init db `npm run init-db`
- Seed tables: `npm run seed-tables`
- Start app `npm start`
- App is running at `http://localhost:3000`

Expand Down
1 change: 1 addition & 0 deletions app-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const DiscussionTypes = {
const Topics = {
ChallengeCreated: 'challenge.notification.create',
ChallengeUpdated: 'challenge.notification.update',
ChallengeDeleted: 'challenge.notification.delete',
ChallengeTypeCreated: 'test.new.bus.events', // 'challenge.action.type.created',
ChallengeTypeUpdated: 'test.new.bus.events', // 'challenge.action.type.updated',
ChallengePhaseCreated: 'test.new.bus.events', // 'challenge.action.phase.created',
Expand Down
4 changes: 2 additions & 2 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module.exports = {
KAFKA_ERROR_TOPIC: process.env.KAFKA_ERROR_TOPIC || 'common.error.reporting',

AMAZON: {
// AWS_ACCESS_KEY_ID: process.env.AWS_FAKE_ID,
// AWS_SECRET_ACCESS_KEY: process.env.AWS_FAKE_KEY,
// AWS_ACCESS_KEY_ID: process.env.AWS_FAKE_ID || "FAKE_ACCESS_KEY",
// AWS_SECRET_ACCESS_KEY: process.env.AWS_FAKE_KEY || "FAKE_SECRET_ACCESS_KEY",
AWS_REGION: process.env.AWS_REGION || 'ap-northeast-1',
IS_LOCAL_DB: process.env.IS_LOCAL_DB || true,
DYNAMODB_URL: process.env.DYNAMODB_URL || 'http://localhost:8000',
Expand Down
50 changes: 50 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,50 @@ paths:
description: Server error
schema:
$ref: '#/definitions/ErrorModel'
delete:
tags:
- Challenges
description: >
Delete the challenge with the provided id.
Only challenges with status of "New" can be deleted.
security:
- bearer: []
produces:
- application/json
parameters:
- name: challengeId
in: path
required: true
type: string
format: UUID
description: The id of challenge to update
responses:
'200':
description: Deleted - The request was successful and the resource is returned.
schema:
$ref: '#/definitions/Challenge'
'400':
description: Bad request. Request parameters were invalid.
schema:
$ref: '#/definitions/ErrorModel'
'401':
description: Unauthorized. Fail to authenticate the requester.
schema:
$ref: '#/definitions/ErrorModel'
'403':
description: >
Forbidden. The requester does not have the correct permission to
update the challenge.
schema:
$ref: '#/definitions/ErrorModel'
'404':
description: Challenge not found
schema:
$ref: '#/definitions/ErrorModel'
'500':
description: Server error
schema:
$ref: '#/definitions/ErrorModel'
/challenge-types:
get:
tags:
Expand Down Expand Up @@ -2433,6 +2477,9 @@ definitions:
numOfRegistrants:
type: integer
description: number of registrants
overview:
description: the overview of the challenge
type: object
created:
type: string
format: date-time
Expand Down Expand Up @@ -2903,6 +2950,9 @@ definitions:
numOfRegistrants:
type: integer
description: number of registrants
overview:
description: the overview of the challenge
type: object
created:
type: string
format: date-time
Expand Down
Loading