Skip to content

Commit

Permalink
Remove recreate mod when changing mod type (#311)
Browse files Browse the repository at this point in the history
This will:
- title
This is no longer needed as mod type cannot be changed on edit form
  • Loading branch information
jskowronski39 authored Jan 8, 2024
2 parents cae15b2 + 7e7f773 commit a7c62eb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Controller/Mod/UpdateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ public function __invoke(Request $request, AbstractMod $mod): Response
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
$updatedMod = $this->dataTransformerRegistry->transformToEntity($modFormDto, $mod);

if (!$this->entityManager->contains($updatedMod)) {
$this->entityManager->remove($mod);
$this->entityManager->persist($updatedMod);
}
$this->dataTransformerRegistry->transformToEntity($modFormDto, $mod);

$this->entityManager->flush();

Expand Down

0 comments on commit a7c62eb

Please sign in to comment.