feat: translation codes
This commit is contained in:
@@ -51,13 +51,13 @@ class StravaController extends Controller
|
||||
|
||||
if (! is_array($state) || $state['user_id'] !== $request->user()->getKey()) {
|
||||
return response()->json([
|
||||
'message' => __('api.strava.state_expired'),
|
||||
'code' => 'STRAVA_STATE_EXPIRED',
|
||||
], 422);
|
||||
}
|
||||
|
||||
if (isset($data['error'])) {
|
||||
return response()->json([
|
||||
'message' => __('api.strava.refused'),
|
||||
'code' => 'STRAVA_AUTHORIZATION_REFUSED',
|
||||
], 422);
|
||||
}
|
||||
|
||||
@@ -115,14 +115,14 @@ class StravaController extends Controller
|
||||
report($exception);
|
||||
|
||||
return response()->json([
|
||||
'message' => __('api.strava.disconnect_failed'),
|
||||
'code' => 'STRAVA_DISCONNECT_FAILED',
|
||||
], 502);
|
||||
}
|
||||
} catch (ConnectionException $exception) {
|
||||
report($exception);
|
||||
|
||||
return response()->json([
|
||||
'message' => __('api.strava.disconnect_failed'),
|
||||
'code' => 'STRAVA_DISCONNECT_FAILED',
|
||||
], 502);
|
||||
}
|
||||
|
||||
@@ -137,13 +137,13 @@ class StravaController extends Controller
|
||||
|
||||
if (! $connection) {
|
||||
return response()->json([
|
||||
'message' => __('api.strava.missing_connection'),
|
||||
'code' => 'STRAVA_CONNECTION_MISSING',
|
||||
], 422);
|
||||
}
|
||||
|
||||
if (! $this->canReadActivities($connection->scopes ?? [])) {
|
||||
return response()->json([
|
||||
'message' => __('api.strava.missing_activity_scope'),
|
||||
'code' => 'STRAVA_ACTIVITY_SCOPE_MISSING',
|
||||
], 422);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user