correct wrong ternary condition
This commit is contained in:
@@ -354,7 +354,7 @@ class UserController extends Controller
|
|||||||
public function toggleEmailNotifications(Request $request, int $id): JsonResponse {
|
public function toggleEmailNotifications(Request $request, int $id): JsonResponse {
|
||||||
try {
|
try {
|
||||||
$user = User::findOrFail($id);
|
$user = User::findOrFail($id);
|
||||||
$user->email_notifications = !$user->email_notifications ? 0 : 1;
|
$user->email_notifications = $user->email_notifications ? 0 : 1;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
return response()->json($user);
|
return response()->json($user);
|
||||||
@@ -367,7 +367,7 @@ class UserController extends Controller
|
|||||||
public function toggleWebNotifications(Request $request, int $id): JsonResponse {
|
public function toggleWebNotifications(Request $request, int $id): JsonResponse {
|
||||||
try {
|
try {
|
||||||
$user = User::findOrFail($id);
|
$user = User::findOrFail($id);
|
||||||
$user->web_notifications = !$user->web_notifications ? 0 : 1;
|
$user->web_notifications = $user->web_notifications ? 0 : 1;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
return response()->json($user);
|
return response()->json($user);
|
||||||
|
|||||||
Reference in New Issue
Block a user