feat(tenant): add asset URL to tenant resource response
This commit is contained in:
@@ -32,6 +32,7 @@ class TenantResource extends JsonResource
|
|||||||
'site_title' => $this->site_title
|
'site_title' => $this->site_title
|
||||||
?? $this->websiteType?->site_title
|
?? $this->websiteType?->site_title
|
||||||
?? 'ShopitFront',
|
?? 'ShopitFront',
|
||||||
|
'asset_url' => config('filesystems.disks.s3.url'),
|
||||||
'address' => $this->address,
|
'address' => $this->address,
|
||||||
'phone' => $this->phone,
|
'phone' => $this->phone,
|
||||||
'favicon' => ($this->favicon ?? $this->websiteType?->favicon)
|
'favicon' => ($this->favicon ?? $this->websiteType?->favicon)
|
||||||
|
|||||||
@@ -128,6 +128,16 @@ class BootstrapTenantControllerTest extends TestCase
|
|||||||
$this->assertArrayNotHasKey('props', $response->json('data'));
|
$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
|
public function test_it_bootstraps_a_tenant_from_a_full_url(): void
|
||||||
{
|
{
|
||||||
$this->createTenant([
|
$this->createTenant([
|
||||||
|
|||||||
Reference in New Issue
Block a user