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;
|
$original = $request->user()->email;
|
||||||
$this->updateService->handle($request->user(), $request->validated());
|
$this->updateService->handle($request->user(), $request->validated());
|
||||||
|
|
||||||
Activity::event('user:account.email-changed')
|
if ($original !== $request->input('email')) {
|
||||||
->property(['old' => $original, 'new' => $request->input('email')])
|
Activity::event('user:account.email-changed')
|
||||||
->log();
|
->property(['old' => $original, 'new' => $request->input('email')])
|
||||||
|
->log();
|
||||||
|
}
|
||||||
|
|
||||||
return new JsonResponse([], Response::HTTP_NO_CONTENT);
|
return new JsonResponse([], Response::HTTP_NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue