Skip to content

Commit 5337851

Browse files
authored
Merge pull request #357 from marioskranitsas/issue-356
fix issue #356
2 parents be1fcea + 2625243 commit 5337851

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

app-constants.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ const challengeTextSortField = {
8585
TypeId: 'typeId'
8686
}
8787

88+
const reviewTypes = {
89+
Community: 'COMMUNITY',
90+
Internal: 'INTERNAL'
91+
}
92+
8893
module.exports = {
8994
UserRoles,
9095
prizeSetTypes,
@@ -95,5 +100,6 @@ module.exports = {
95100
Topics,
96101
challengeTracks,
97102
challengeTextSortField,
98-
DiscussionTypes
103+
DiscussionTypes,
104+
reviewTypes
99105
}

docs/swagger.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,6 +2550,10 @@ definitions:
25502550
reviewType:
25512551
type: string
25522552
description: the review type
2553+
enum:
2554+
- 'INTERNAL'
2555+
- 'COMMUNITY'
2556+
default: 'INTERNAL'
25532557
forumId:
25542558
type: integer
25552559
description: the forum id
@@ -2718,7 +2722,6 @@ definitions:
27182722
- prizeSets
27192723
- created
27202724
- createdBy
2721-
- reviewType
27222725
- tags
27232726
- status
27242727
Attachment:
@@ -2962,13 +2965,16 @@ definitions:
29622965
type: string
29632966
reviewType:
29642967
type: string
2968+
enum:
2969+
- 'INTERNAL'
2970+
- 'COMMUNITY'
2971+
default: 'INTERNAL'
29652972
confidentialityType:
29662973
type: string
29672974
forumId:
29682975
type: number
29692976
required:
29702977
- track
2971-
- reviewType
29722978
name:
29732979
type: string
29742980
description:
@@ -3246,7 +3252,6 @@ definitions:
32463252
- prizeSets
32473253
- created
32483254
- createdBy
3249-
- reviewType
32503255
- tags
32513256
- projectId
32523257
- forumId

src/services/ChallengeService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ createChallenge.schema = {
959959
typeId: Joi.id(),
960960
trackId: Joi.id(),
961961
legacy: Joi.object().keys({
962-
reviewType: Joi.string().required(),
962+
reviewType: Joi.string().valid(_.values(constants.reviewTypes)).default(constants.reviewTypes.Internal),
963963
confidentialityType: Joi.string().default(config.DEFAULT_CONFIDENTIALITY_TYPE),
964964
forumId: Joi.number().integer(),
965965
directProjectId: Joi.number().integer(),
@@ -1703,7 +1703,7 @@ fullyUpdateChallenge.schema = {
17031703
challengeId: Joi.id(),
17041704
data: Joi.object().keys({
17051705
legacy: Joi.object().keys({
1706-
reviewType: Joi.string().required(),
1706+
reviewType: Joi.string().valid(_.values(constants.reviewTypes)).default(constants.reviewTypes.Internal),
17071707
confidentialityType: Joi.string().default(config.DEFAULT_CONFIDENTIALITY_TYPE),
17081708
forumId: Joi.number().integer(),
17091709
directProjectId: Joi.number().integer(),
@@ -1802,7 +1802,7 @@ partiallyUpdateChallenge.schema = {
18021802
legacy: Joi.object().keys({
18031803
track: Joi.string(),
18041804
subTrack: Joi.string(),
1805-
reviewType: Joi.string(),
1805+
reviewType: Joi.string().valid(_.values(constants.reviewTypes)).default(constants.reviewTypes.Internal),
18061806
confidentialityType: Joi.string().default(config.DEFAULT_CONFIDENTIALITY_TYPE),
18071807
directProjectId: Joi.number(),
18081808
forumId: Joi.number().integer(),

0 commit comments

Comments
 (0)