Skip to content

Commit

Permalink
Update csv file for importing new programs
Browse files Browse the repository at this point in the history
  • Loading branch information
MaelCormier-CGI committed Jan 15, 2025
1 parent 4d6df6e commit 1f93510
Show file tree
Hide file tree
Showing 2 changed files with 1,077 additions and 1,984 deletions.
4 changes: 3 additions & 1 deletion app/Console/Commands/UpdateExistingPrograms.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public function handle()
$records = $csv->getRecords();

foreach ($records as $record) {
$program = Program::where('guid', $record['Progam_guid'])->first();
// Remove any hyphens that could be exist in the csv file provided
$program_guid = str_replace('-', '', $record['Progam_guid']);
$program = Program::where('guid', $program_guid)->first();

if (!$program) {
$this->error("Program not found: {$record['Progam_guid']}");
Expand Down
Loading

0 comments on commit 1f93510

Please sign in to comment.