Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 2250362

Browse files
Revert "Feature/projectid"
1 parent d7356ed commit 2250362

File tree

6 files changed

+4
-82
lines changed

6 files changed

+4
-82
lines changed

config/default.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,5 @@ module.exports = {
227227
}
228228
},
229229

230-
COPILOT_PAYMENT_TYPE: process.env.COPILOT_PAYMENT_TYPE || 'copilot',
231-
MARATHON_MATCH_PROJECT_INFO_TYPE_ID: 56
230+
COPILOT_PAYMENT_TYPE: process.env.COPILOT_PAYMENT_TYPE || 'copilot'
232231
}

docs/swagger.yaml

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ paths:
122122
summary: Delete a challenge's migration record, sync record, challenge entry, and resources
123123
tags:
124124
- Migration
125-
operationId: getChallenge
125+
operationId: destroyChallenge
126126
security:
127127
- bearer: []
128128
responses:
@@ -137,29 +137,6 @@ paths:
137137
500:
138138
$ref: '#/definitions/ServerError'
139139

140-
'/challenge-migration/getChallengeProjectId/{roundId}':
141-
get:
142-
parameters:
143-
- name: roundId
144-
in: path
145-
description: The roundId of record
146-
required: true
147-
type: string
148-
summary: get the projectId by roundId
149-
tags:
150-
- Migration
151-
operationId: Challenge
152-
security:
153-
- bearer: []
154-
responses:
155-
200:
156-
schema:
157-
$ref: '#/definitions/ProjectIdObject'
158-
400:
159-
$ref: '#/definitions/BadRequest'
160-
500:
161-
$ref: '#/definitions/ServerError'
162-
163140
'/challenge-migration/sync':
164141
get:
165142
summary: Get Sync status.
@@ -225,14 +202,6 @@ paths:
225202

226203

227204
definitions:
228-
ProjectIdObject:
229-
description: The project id of challenge
230-
type: object
231-
properties:
232-
projectId:
233-
type: number
234-
description: The ProjectId
235-
example: 23234
236205
MigrationStatusObject:
237206
description: The Migration Status Object.
238207
type: object
@@ -315,5 +284,4 @@ definitions:
315284
message:
316285
type: string
317286
description: The conflict error message.
318-
example: Creating a resource with a name already exists.
319-
287+
example: Creating a resource with a name already exists.

src/controllers/apiController.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -184,23 +184,6 @@ async function convertV4TrackToV5 (req, res) {
184184
return res.json(translationService.convertV4TrackToV5(track, subTrack, isTask, tags))
185185
}
186186

187-
async function getChallengeProjectId (req, res) {
188-
const roundId = _.get(req, 'params.roundId')
189-
if (!roundId) {
190-
return res.status(400).json({ message: `Invalid roundId: ${roundId}` })
191-
}
192-
try {
193-
const result = await challengeService.getChallengeProjectId(roundId)
194-
if (result.length > 0) {
195-
return res.json({ projectId: result[0].project_id})
196-
}
197-
return res.status(404).json({ message: 'projectId Not found' })
198-
} catch (e) {
199-
logger.debug(`Error in GetChallengeProjectId: ${e}`)
200-
return res.status(400).json({ message: `Unable to GetChallengeProjectId: ${JSON.stringify(e)}` })
201-
}
202-
}
203-
204187
module.exports = {
205188
queueForMigration,
206189
getMigrationStatus,
@@ -209,6 +192,5 @@ module.exports = {
209192
getSyncStatus,
210193
destroyChallenge,
211194
convertV5TrackToV4,
212-
convertV4TrackToV5,
213-
getChallengeProjectId
195+
convertV4TrackToV5
214196
}

src/routes.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,5 @@ module.exports = {
6262
auth: 'jwt',
6363
scopes: [CHALLENGES.WRITE, CHALLENGES.ALL]
6464
}
65-
},
66-
'/challenge-migration/getChallengeProjectId/:roundId': {
67-
get: {
68-
controller: 'apiController',
69-
method: 'getChallengeProjectId'
70-
}
7165
}
7266
}

src/services/challengeInformixService.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
const _ = require('lodash')
2-
const config = require('config')
32
const logger = require('../util/logger')
43
const helper = require('../util/helper')
54
// const getErrorService = require('./errorService')
65
const { executeQueryAsync } = require('../util/informixWrapper')
76

8-
/**
9-
* Get projectId
10-
* @param {Number} roundId the Round ID
11-
*/
12-
async function getProjectIdFromIfx (roundId) {
13-
const sql = `SELECT limit 1
14-
project_id
15-
FROM project_info
16-
WHERE value = ${roundId} and project_info_type_id = ${config.MARATHON_MATCH_PROJECT_INFO_TYPE_ID}
17-
`
18-
// logger.info(`projectId SQL: ${sql}`)
19-
return execQuery(sql)
20-
}
21-
227
/**
238
* Get effort hours for a legacyId
249
* @param {Number} legacyId the legacy ID
@@ -695,7 +680,6 @@ async function execQuery (sql) {
695680
module.exports = {
696681
execQuery,
697682
getChallengeInfo,
698-
getProjectIdFromIfx,
699683
getMetadataFromIfx,
700684
getChallengesFromIfx,
701685
getChallengeIdsFromIfx,

src/services/challengeService.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,6 @@ async function getChallengeSubmissionsFromV5API (challengeId, type) {
942942
return { results: [], total: 0 }
943943
}
944944

945-
async function getChallengeProjectId (roundId) {
946-
return challengeInformixService.getProjectIdFromIfx(roundId)
947-
}
948-
949945
module.exports = {
950946
save,
951947
buildV5Challenge,
@@ -966,6 +962,5 @@ module.exports = {
966962
getMMatchFromV4API,
967963
getChallengeTypesFromDynamo,
968964
getChallengeSubmissionsFromV5API,
969-
getChallengeProjectId,
970965
mapTimelineTemplateId
971966
}

0 commit comments

Comments
 (0)