fix: separates get/post routes

This commit is contained in:
2025-07-23 21:37:31 -05:00
parent 93f5b716b2
commit 75e9c1e8c3
3 changed files with 46 additions and 17 deletions

View File

@@ -11,11 +11,14 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class UserMediaPreferencesForm extends AbstractType
{
public function __construct(
private readonly PreferenceOptionRepository $preferenceOptionRepository,
private readonly UrlGeneratorInterface $urlGenerator,
) {}
public function buildForm(FormBuilderInterface $builder, array $options): void
@@ -30,6 +33,7 @@ class UserMediaPreferencesForm extends AbstractType
private function addChoiceField(FormBuilderInterface $builder, string $fieldName, array $choices): void
{
$question = [
'action' => $this->urlGenerator->generate('app_user_preferences_submit'),
'attr' => ['class' => 'w-64 text-input mb-4'],
'label_attr' => ['class' => 'w-64 text-white block font-semibold mb-2'],
'choices' => $this->addDefaultChoice($choices),