feat: translation codes
CI / 🧪 Tests Laravel (push) Successful in 2m34s
CI / 🐳 Build & Push Images (push) Successful in 2m26s

This commit is contained in:
2026-08-14 12:46:29 +02:00
parent 69372a49ed
commit 8b60283eeb
28 changed files with 59 additions and 62 deletions
+5 -5
View File
@@ -19,7 +19,7 @@ class FollowController extends Controller
if ($authUser->id === $user->id) {
return response()->json([
'message' => __('api.follows.cannot_follow_self'),
'code' => 'CANNOT_FOLLOW_SELF',
], 422);
}
@@ -38,7 +38,7 @@ class FollowController extends Controller
}
return response()->json([
'message' => __('api.follows.followed'),
'code' => 'USER_FOLLOWED',
'status' => $status,
]);
}
@@ -48,7 +48,7 @@ class FollowController extends Controller
$request->user()->following()->detach($user->id);
return response()->json([
'message' => __('api.follows.unfollowed'),
'code' => 'USER_UNFOLLOWED',
]);
}
@@ -61,7 +61,7 @@ class FollowController extends Controller
]);
return response()->json([
'message' => $updated ? __('api.follows.accepted') : __('api.follows.not_found'),
'code' => $updated ? 'FOLLOW_REQUEST_ACCEPTED' : 'FOLLOW_REQUEST_NOT_FOUND',
]);
}
@@ -72,7 +72,7 @@ class FollowController extends Controller
$detached = $request->user()->followers()->detach($user->id);
return response()->json([
'message' => $detached ? __('api.follows.rejected') : __('api.follows.not_found'),
'code' => $detached ? 'FOLLOW_REQUEST_REJECTED' : 'FOLLOW_REQUEST_NOT_FOUND',
]);
}