<?php

namespace App\Domains\Admin\Controllers;

use App\Scopes\CommonController;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class ManagedTenantImpressGetController extends CommonController
{
    public function __invoke(string $slug, Request $request): JsonResponse
    {
        $tenant = $this->adminTenants->findBySlug($slug);

        return response()->json([
            'impress_text' => $tenant->impress_text ?? '',
            'saveEndpoint' => '/api/v1/admin/tenants/' . $slug . '/impress',
        ]);
    }
}
