Skip to content

Commit aebba9c

Browse files
skip the null external Id
1 parent b89a652 commit aebba9c

File tree

1 file changed

+2
-2
lines changed
  • scripts/job-rcrm-status-migration-v2

1 file changed

+2
-2
lines changed

scripts/job-rcrm-status-migration-v2/backup.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function backup () {
1616
fs.rmdirSync(filePath, { recursive: true })
1717
}
1818
fs.mkdirSync(filePath)
19-
let { body: jobs } = await request.get('https://www.topcoder.com/api/recruit/jobs?job_status=1')
19+
let { body: jobs } = await request.get('https://www.topcoder-dev.com/api/recruit/jobs?job_status=1')
2020
jobs = jobs.map((item) => item.slug)
2121
const backupJobs = []
2222
if (jobs && jobs.length > 0) {
@@ -25,7 +25,7 @@ async function backup () {
2525
where: { rcrmStatus: 'Open' }
2626
})
2727
for (const j of jbsInDb) {
28-
if (jobs.indexOf(j.externalId) < 0) {
28+
if (j.externalId && jobs.indexOf(j.externalId) < 0) {
2929
// The open job exists in taas but not showing up on Community-App
3030
backupJobs.push(j.externalId)
3131
}

0 commit comments

Comments
 (0)