Skip to content

Commit

Permalink
Fix UserProfileTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed May 10, 2024
1 parent 1f8c6f2 commit 0e62380
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Http/Requests/UserProfileRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ public function validator()
$this->submittedValues = $this->valuesWithoutAssetFields($fields);
$this->blueprintFields = $fields->addValues($this->submittedValues);

$userId = User::current()->id();

return $this->blueprintFields
->validator()
->withRules(['email' => ['required', 'email', new UniqueUserValue(except: $user->id())]])
->withReplacements(['id' => User::current()->id()])
->withRules(['email' => ['required', 'email', new UniqueUserValue(except: $userId)]])
->withReplacements(['id' => $userId])
->validator();
}

Expand Down

0 comments on commit 0e62380

Please sign in to comment.