diff --git a/app/Http/Controllers/Api/V1/TimeEntryController.php b/app/Http/Controllers/Api/V1/TimeEntryController.php index 61bdf76f..2d6ad425 100644 --- a/app/Http/Controllers/Api/V1/TimeEntryController.php +++ b/app/Http/Controllers/Api/V1/TimeEntryController.php @@ -453,8 +453,8 @@ public function destroyMultiple(Organization $organization, TimeEntryDestroyMult ->whereIn('id', $ids) ->get(); - $success = new Collection(); - $error = new Collection(); + $success = new Collection; + $error = new Collection; foreach ($ids as $id) { /** @var TimeEntry|null $timeEntry */ diff --git a/app/Service/ApiService.php b/app/Service/ApiService.php index 9cb8ce00..7bb07061 100644 --- a/app/Service/ApiService.php +++ b/app/Service/ApiService.php @@ -18,7 +18,7 @@ class ApiService { - private const string API_URL = 'https://app.solidtime.io/api'; + private const string API_URL = 'https://app.solidtime.io/api/v1'; public function checkForUpdate(): ?string { @@ -26,7 +26,7 @@ public function checkForUpdate(): ?string $response = Http::asJson() ->timeout(3) ->connectTimeout(2) - ->post(self::API_URL.'/check-for-update', [ + ->post(self::API_URL.'/ping/version', [ 'version' => config('app.version'), 'build' => config('app.build'), 'url' => config('app.url'), @@ -57,7 +57,7 @@ public function telemetry(): bool $response = Http::asJson() ->timeout(3) ->connectTimeout(2) - ->post(self::API_URL.'/telemetry', [ + ->post(self::API_URL.'/ping/telemetry', [ 'version' => config('app.version'), 'build' => config('app.build'), 'url' => config('app.url'), diff --git a/tests/Unit/Console/Commands/SelfHost/SelfHostCheckForUpdateCommandTest.php b/tests/Unit/Console/Commands/SelfHost/SelfHostCheckForUpdateCommandTest.php index 8d21a58c..3c67f139 100644 --- a/tests/Unit/Console/Commands/SelfHost/SelfHostCheckForUpdateCommandTest.php +++ b/tests/Unit/Console/Commands/SelfHost/SelfHostCheckForUpdateCommandTest.php @@ -24,7 +24,7 @@ public function test_checks_for_update_and_saves_version_in_cache(): void { // Arrange Http::fake([ - 'https://app.solidtime.io/api/check-for-update' => Http::response(['version' => '1.2.3'], 200), + 'https://app.solidtime.io/api/v1/ping/version' => Http::response(['version' => '1.2.3'], 200), ]); // Act @@ -40,7 +40,7 @@ public function test_checks_for_update_fails_gracefully_if_response_has_error_st { // Arrange Http::fake([ - 'https://app.solidtime.io/api/check-for-update' => Http::response(null, 500), + 'https://app.solidtime.io/api/v1/ping/version' => Http::response(null, 500), ]); // Act @@ -56,7 +56,7 @@ public function test_checks_for_update_fails_gracefully_if_timeout_happens(): vo { // Arrange Http::fake([ - 'https://app.solidtime.io/api/check-for-update' => function (): void { + 'https://app.solidtime.io/api/v1/ping/version' => function (): void { throw new ConnectionException('Connection timed out'); }, ]); diff --git a/tests/Unit/Console/Commands/SelfHost/SelfHostTelemetryCommandTest.php b/tests/Unit/Console/Commands/SelfHost/SelfHostTelemetryCommandTest.php index f92655fc..be436152 100644 --- a/tests/Unit/Console/Commands/SelfHost/SelfHostTelemetryCommandTest.php +++ b/tests/Unit/Console/Commands/SelfHost/SelfHostTelemetryCommandTest.php @@ -23,7 +23,7 @@ public function test_telemetry_sends_data_to_telemetry_endpoint_of_solidtime_clo { // Arrange Http::fake([ - 'https://app.solidtime.io/api/telemetry' => Http::response(['success' => true], 200), + 'https://app.solidtime.io/api/v1/ping/telemetry' => Http::response(['success' => true], 200), ]); // Act @@ -39,7 +39,7 @@ public function test_telemetry_sends_fails_gracefully_if_response_has_error_stat { // Arrange Http::fake([ - 'https://app.solidtime.io/api/telemetry' => Http::response(null, 500), + 'https://app.solidtime.io/api/v1/ping/telemetry' => Http::response(null, 500), ]); // Act @@ -55,7 +55,7 @@ public function test_telemetry_sends_fails_gracefully_if_timeout_happens(): void { // Arrange Http::fake([ - 'https://app.solidtime.io/api/telemetry' => function (): void { + 'https://app.solidtime.io/api/v1/ping/telemetry' => function (): void { throw new ConnectionException('Connection timed out'); }, ]);