Skip to content

Fixed an issue with missing number casting in the import data script#269

Merged
stasel merged 1 commit intomainfrom
import-script-fix
Jan 12, 2026
Merged

Fixed an issue with missing number casting in the import data script#269
stasel merged 1 commit intomainfrom
import-script-fix

Conversation

@stasel
Copy link
Member

@stasel stasel commented Jan 12, 2026

This caused the POST /trainee API call to fail because the cohort number was from a string type and on the backend, it expects a number.

Copilot AI review requested due to automatic review settings January 12, 2026 08:28
@HackYourFutures HackYourFutures temporarily deployed to dojo-import-script-fix-potmmui January 12, 2026 08:29 Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a type casting issue in the trainee data import script where cohort numbers were being sent as strings instead of numbers, causing API call failures. The changes convert CSV string values to numbers and relocate configuration constants for better organization.

Changes:

  • Added Number.parseInt() calls to convert startCohort and currentCohort fields from strings to numbers
  • Moved URL and TOKEN configuration constants to the top of the file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@stasel stasel force-pushed the import-script-fix branch from 5238e07 to ac93d7a Compare January 12, 2026 14:03
@HackYourFutures HackYourFutures temporarily deployed to dojo-import-script-fix-potmmui January 12, 2026 14:03 Inactive
@stasel stasel merged commit 43aba6d into main Jan 12, 2026
1 check passed
@stasel stasel deleted the import-script-fix branch January 12, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants