Skip to content

Support changing legacy.track or typeId #90

Open
@ThomasKranitsas

Description

@ThomasKranitsas

The v5 used to allow changing the legacy.track or the typeId of a Challenge but V4 doesn't allow that.

Thought, the V4 API does not return the challenge track in the response of the /challenges/:id endpoint thus we moved that check to the V5 API

https://github.com/topcoder-platform/legacy-challenge-processor/blob/7d94bea995c2d248b897d187064664f76c6abd2b/src/services/ProcessorService.js#L272-L281

// FIXME: Tech Dept
if (_.get(challenge, 'legacy.track') && _.get(data, 'legacy.track') && _.get(challenge, 'legacy.track') !== _.get(data, 'legacy.track')) {
throw new errors.ForbiddenError('Cannot change legacy.track')
}
if (_.get(challenge, 'typeId') && _.get(data, 'typeId') && _.get(challenge, 'typeId') !== _.get(data, 'typeId')) {
throw new errors.ForbiddenError('Cannot change typeId')
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions