feat: notifies user of bad RD download (failed for copyright, etc.)
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 13s
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 13s
This commit is contained in:
@@ -15,6 +15,7 @@ use App\Download\DownloadEvents;
|
||||
use App\Download\Framework\Repository\DownloadRepository;
|
||||
use App\EventLog\Action\Command\AddEventLogCommand;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Messenger\MessageBusInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
@@ -22,9 +23,9 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
class ApiController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private DownloadRepository $downloadRepository,
|
||||
private MessageBusInterface $bus,
|
||||
private readonly Broadcaster $broadcaster,
|
||||
private DownloadRepository $downloadRepository,
|
||||
private MessageBusInterface $bus,
|
||||
private readonly Broadcaster $broadcaster, private readonly RequestStack $requestStack,
|
||||
) {}
|
||||
|
||||
#[Route('/api/download', name: 'api_download', methods: ['POST'])]
|
||||
@@ -42,6 +43,7 @@ class ApiController extends AbstractController
|
||||
);
|
||||
$input->downloadId = $download->getId();
|
||||
$input->userId = $this->getUser()->getId();
|
||||
$input->mercureAlertTopic = $this->requestStack->getSession()->get('mercure_alert_topic');
|
||||
|
||||
$this->bus->dispatch(new AddEventLogCommand(
|
||||
$this->getUser(),
|
||||
|
||||
Reference in New Issue
Block a user