Fix: Adopt current document status in form

This commit is contained in:
Björn Fromme
2023-10-25 16:03:20 +02:00
parent b76124b956
commit 6d90c5c3d9
2 changed files with 6 additions and 2 deletions
@@ -61,7 +61,10 @@ class CheckController extends AbstractController
$this->rejectDocument($document, $formData->getComment());
$this->eventDispatcher->dispatch(new DocumentRejectedEvent($formData), DocumentRejectedEvent::NAME);
default:
$document->setStatus($formData->getStatus());
$document
->setStatus($formData->getStatus())
->setComment($formData->getComment())
;
$this->entityManager->flush();
$this->addFlash('success', 'Der Status wurde aktualisiert');
$this->logger->info('Update document status', [
+2 -1
View File
@@ -8,11 +8,12 @@ class DocumentCheckDto
{
private Upload $upload;
private ?string $status = null;
private ?string $comment = null;
private ?string $comment;
public function __construct(Upload $upload)
{
$this->upload = $upload;
$this->comment = $upload->getComment();
}
public function getUpload(): Upload