Skip to content

Commit

Permalink
Merge pull request #32 from ronei-kunkel/beta
Browse files Browse the repository at this point in the history
Basic input validation
  • Loading branch information
ronei-kunkel authored Oct 23, 2023
2 parents 4db9426 + d9478c5 commit f68b43f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Module/Auth/Infra/Controller/UserAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __invoke(): JsonResponse

$data = $this->request->all();

$input = new UserAuthInput($data['email'], $data['password']);
$input = new UserAuthInput($data['email'] ?? '', $data['password'] ?? '');

$output = $this->action->handle($input);

Expand Down
2 changes: 1 addition & 1 deletion src/Module/Drink/Infra/Controller/UserDrinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __invoke(): JsonResponse
{
$data = $this->request->all();

$input = new UserDrinkInput($data['user']['id'], $data['quantity'] ?? 1);
$input = new UserDrinkInput($data['user']['id'] ?? 0, $data['quantity'] ?? 1);

try {
$user = $this->action->handle($input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __invoke(): JsonResponse
{
$data = $this->request->all();

$input = new UserRegisterInput($data['name'], $data['email'], $data['password']);
$input = new UserRegisterInput($data['name'] ?? '', $data['email'] ?? '', $data['password'] ?? '');

try {

Expand Down

0 comments on commit f68b43f

Please sign in to comment.