Skip to content

Commit

Permalink
Fix api url
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Oct 9, 2024
1 parent ddf11b3 commit 9602ae5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/V1/TimeEntryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions app/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

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
{
try {
$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'),
Expand Down Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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');
},
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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');
},
]);
Expand Down

0 comments on commit 9602ae5

Please sign in to comment.