fix: movie_folder download preference not saving when unchecked
This commit is contained in:
28
src/User/Action/Input/SaveUserDownloadPreferencesInput.php
Normal file
28
src/User/Action/Input/SaveUserDownloadPreferencesInput.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Action\Input;
|
||||
|
||||
use App\User\Action\Command\SaveUserDownloadPreferencesCommand;
|
||||
use OneToMany\RichBundle\Attribute\SourceRequest;
|
||||
use OneToMany\RichBundle\Attribute\SourceSecurity;
|
||||
use OneToMany\RichBundle\Contract\CommandInterface as C;
|
||||
use OneToMany\RichBundle\Contract\InputInterface;
|
||||
|
||||
/** @implements InputInterface<SaveUserDownloadPreferencesInput, SaveUserDownloadPreferencesCommand> */
|
||||
class SaveUserDownloadPreferencesInput implements InputInterface
|
||||
{
|
||||
public function __construct(
|
||||
#[SourceSecurity]
|
||||
public mixed $userId,
|
||||
|
||||
#[SourceRequest('movie_folder', nullify: true)]
|
||||
public bool $movieFolder,
|
||||
) {}
|
||||
|
||||
public function toCommand(): C
|
||||
{
|
||||
return new SaveUserDownloadPreferencesCommand(
|
||||
$this->movieFolder,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user