Skip to content

Commit

Permalink
fix: Report download
Browse files Browse the repository at this point in the history
  • Loading branch information
famoser authored Feb 25, 2023
1 parent cd09620 commit 2ade807
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Empty file removed public/build/images/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion src/Api/CustomController/IssuesReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function __invoke($data)

$path = $this->router->generate('public_download', ['filename' => $filename]);

return new Response($path, Response::HTTP_FOUND);
return new Response($path);
}

private function getAuthor(?TokenInterface $token): ?string
Expand Down
4 changes: 2 additions & 2 deletions tests/Api/IssueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ public function testReport()
$this->loginApiConstructionManager($client);

$constructionSite = $this->getTestConstructionSite();
$this->assertApiGetStatusCodeSame(StatusCode::HTTP_FOUND, $client, '/api/issues/report?constructionSite='.$constructionSite->getId(), 'application/pdf');
$this->assertResponseRedirects();
$response = $this->assertApiGetStatusCodeSame(StatusCode::HTTP_OK, $client, '/api/issues/report?constructionSite='.$constructionSite->getId(), 'application/pdf');
$this->assertTrue(str_contains($response->getContent(), '/download'));
}

public function testRender()
Expand Down

0 comments on commit 2ade807

Please sign in to comment.