diff --git a/app/Domains/Tenant/Resources/TenantResource.php b/app/Domains/Tenant/Resources/TenantResource.php index b0f28cc..1c3b14b 100644 --- a/app/Domains/Tenant/Resources/TenantResource.php +++ b/app/Domains/Tenant/Resources/TenantResource.php @@ -32,6 +32,7 @@ class TenantResource extends JsonResource 'site_title' => $this->site_title ?? $this->websiteType?->site_title ?? 'ShopitFront', + 'asset_url' => config('filesystems.disks.s3.url'), 'address' => $this->address, 'phone' => $this->phone, 'favicon' => ($this->favicon ?? $this->websiteType?->favicon) diff --git a/tests/Feature/Tenant/BootstrapTenantControllerTest.php b/tests/Feature/Tenant/BootstrapTenantControllerTest.php index 80325a9..fe84fa8 100644 --- a/tests/Feature/Tenant/BootstrapTenantControllerTest.php +++ b/tests/Feature/Tenant/BootstrapTenantControllerTest.php @@ -128,6 +128,16 @@ class BootstrapTenantControllerTest extends TestCase $this->assertArrayNotHasKey('props', $response->json('data')); } + public function test_it_returns_the_configured_asset_url_in_the_bootstrap(): void + { + config()->set('filesystems.disks.s3.url', 'https://s3.shopit.com.ar/shopit-local'); + $this->createTenant(); + + $this->getJson('/api/tenants/bootstrap?dominio=acme.com&path=%2F') + ->assertOk() + ->assertJsonPath('data.asset_url', 'https://s3.shopit.com.ar/shopit-local'); + } + public function test_it_bootstraps_a_tenant_from_a_full_url(): void { $this->createTenant([