Don't log activity if the email wasn't actually changed
This commit is contained in:
parent
2d836156d2
commit
0216e3fd5b
1 changed files with 5 additions and 3 deletions
|
@ -50,9 +50,11 @@ class AccountController extends ClientApiController
|
|||
$original = $request->user()->email;
|
||||
$this->updateService->handle($request->user(), $request->validated());
|
||||
|
||||
Activity::event('user:account.email-changed')
|
||||
->property(['old' => $original, 'new' => $request->input('email')])
|
||||
->log();
|
||||
if ($original !== $request->input('email')) {
|
||||
Activity::event('user:account.email-changed')
|
||||
->property(['old' => $original, 'new' => $request->input('email')])
|
||||
->log();
|
||||
}
|
||||
|
||||
return new JsonResponse([], Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue