Skip to content

fix issue #356 #357

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 1 commit into from
Dec 21, 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
8 changes: 7 additions & 1 deletion app-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ const challengeTextSortField = {
TypeId: 'typeId'
}

const reviewTypes = {
Community: 'COMMUNITY',
Internal: 'INTERNAL'
}

module.exports = {
UserRoles,
prizeSetTypes,
Expand All @@ -95,5 +100,6 @@ module.exports = {
Topics,
challengeTracks,
challengeTextSortField,
DiscussionTypes
DiscussionTypes,
reviewTypes
}
11 changes: 8 additions & 3 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2550,6 +2550,10 @@ definitions:
reviewType:
type: string
description: the review type
enum:
- 'INTERNAL'
- 'COMMUNITY'
default: 'INTERNAL'
forumId:
type: integer
description: the forum id
Expand Down Expand Up @@ -2718,7 +2722,6 @@ definitions:
- prizeSets
- created
- createdBy
- reviewType
- tags
- status
Attachment:
Expand Down Expand Up @@ -2962,13 +2965,16 @@ definitions:
type: string
reviewType:
type: string
enum:
- 'INTERNAL'
- 'COMMUNITY'
default: 'INTERNAL'
confidentialityType:
type: string
forumId:
type: number
required:
- track
- reviewType
name:
type: string
description:
Expand Down Expand Up @@ -3246,7 +3252,6 @@ definitions:
- prizeSets
- created
- createdBy
- reviewType
- tags
- projectId
- forumId
Expand Down
6 changes: 3 additions & 3 deletions src/services/ChallengeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ createChallenge.schema = {
typeId: Joi.id(),
trackId: Joi.id(),
legacy: Joi.object().keys({
reviewType: Joi.string().required(),
reviewType: Joi.string().valid(_.values(constants.reviewTypes)).default(constants.reviewTypes.Internal),
confidentialityType: Joi.string().default(config.DEFAULT_CONFIDENTIALITY_TYPE),
forumId: Joi.number().integer(),
directProjectId: Joi.number().integer(),
Expand Down Expand Up @@ -1703,7 +1703,7 @@ fullyUpdateChallenge.schema = {
challengeId: Joi.id(),
data: Joi.object().keys({
legacy: Joi.object().keys({
reviewType: Joi.string().required(),
reviewType: Joi.string().valid(_.values(constants.reviewTypes)).default(constants.reviewTypes.Internal),
confidentialityType: Joi.string().default(config.DEFAULT_CONFIDENTIALITY_TYPE),
forumId: Joi.number().integer(),
directProjectId: Joi.number().integer(),
Expand Down Expand Up @@ -1802,7 +1802,7 @@ partiallyUpdateChallenge.schema = {
legacy: Joi.object().keys({
track: Joi.string(),
subTrack: Joi.string(),
reviewType: Joi.string(),
reviewType: Joi.string().valid(_.values(constants.reviewTypes)).default(constants.reviewTypes.Internal),
confidentialityType: Joi.string().default(config.DEFAULT_CONFIDENTIALITY_TYPE),
directProjectId: Joi.number(),
forumId: Joi.number().integer(),
Expand Down