Skip to content

Commit

Permalink
🔧: new env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
julesartd committed Apr 15, 2024
1 parent 3054463 commit 819d0d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ APP_ENV=
APP_SECRET=
###< symfony/framework-bundle ###

APP_3IL_LOGIN_URL=
APP_3IL_SCHEDULE_URL=
###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
Expand Down
2 changes: 1 addition & 1 deletion backend/.php-cs-fixer.cache

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions backend/src/Controller/Api/StudentLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function index(Request $request): Response
if (null === $username || null === $password) {
return $this->json(['message' => 'Veuillez renseigner un nom d\'utilisateur et un mot de passe'], 400);
}
$studentScrapper = new StudentSpaceScrapperService('https://eleves.groupe3il.fr/index.php');
$studentScrapper = new StudentSpaceScrapperService(getenv('APP_3IL_LOGIN_URL'));
$htmlContent = $studentScrapper->getLoginToken();
$cookieJar = $studentScrapper->getCookies();
$studentLoginService = new StudentLoginService();
Expand All @@ -34,7 +34,7 @@ public function index(Request $request): Response
#[Route('/api/student/marks/{studentId}', name: 'app_api_student_marks')]
public function marksPdf(int $studentId): Response
{
$studentScrapper = new StudentSpaceScrapperService('https://eleves.groupe3il.fr/index.php');
$studentScrapper = new StudentSpaceScrapperService(getenv('APP_3IL_LOGIN_URL'));
$pdfContent = $studentScrapper->getMarksPDF($studentId);
if (!$pdfContent) {
return $this->json(['message' => 'Erreur de récupération du PDF'], 500);
Expand All @@ -45,4 +45,4 @@ public function marksPdf(int $studentId): Response
]);
}
}
}
}

0 comments on commit 819d0d3

Please sign in to comment.