Skip to content

Commit

Permalink
Merge pull request #89 from scify/master
Browse files Browse the repository at this point in the history
Fixed seeder
  • Loading branch information
PavlosIsaris authored Oct 7, 2024
2 parents 6eac7e2 + aebd241 commit 163b548
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions database/seeders/AirQualityProjectSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function run(): void {

$project_translations = [
[
'id' => 6,
'language_id' => 6,
'project_id' => 4,
'name' => 'Air Quality in Europe',
Expand All @@ -62,7 +61,6 @@ public function run(): void {
'questionnaire_response_email_outro_text' => '<p>Thank you for your time and effort.<br></p>',
],
[
'id' => 7,
'language_id' => 12,
'project_id' => 4,
'name' => 'Η Ποιότητα του Αέρα στην Ευρώπη',
Expand All @@ -89,10 +87,10 @@ public function run(): void {
}

foreach ($project_translations as $project_translation) {
$this->projectTranslationRepository->updateOrCreate(['id' => $project_translation['id']],
$this->projectTranslationRepository->updateOrCreate(['project_id' => $project_translation['project_id'], 'language_id' => $project_translation['language_id']],
Helpers::getFilteredAttributes($project_translation, (new CrowdSourcingProjectTranslation)->getFillable()));
if (app()->environment() !== 'testing') {
echo "\nAdded Project Translation: " . $project_translation['name'] . ' with id: ' . $project_translation['id'] . "\n";
echo "\nAdded Project Translation: " . $project_translation['name'] . ' with lang id: ' . $project_translation['language_id'] . "\n";
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use App\Models\UserRole;
use App\Repository\CrowdSourcingProject\CrowdSourcingProjectRepository;
use Faker\Factory as Faker;
use Tests\TestCase;
use Illuminate\Support\Str;
use Tests\TestCase;

class CrowdSourcingProjectControllerTest extends TestCase {
protected CrowdSourcingProjectRepository $crowdSourcingProjectRepository;
Expand Down

0 comments on commit 163b548

Please sign in to comment.