<?php

declare(strict_types=1);

namespace App\Http\Controllers\API\V1\Auth;

use App\Http\Controllers\API\V1\Auth\Transformers\PouzivatelTransformer;
use Dingo\Api\Http\Response;
use Dingo\Api\Routing\Helpers;
use Illuminate\Routing\Controller;

/**
 * Class MeAction
 */
class MeAction extends Controller
{
    use Helpers;

    public function __invoke(): Response
    {
        /** @var \App\Models\Pouzivatel\Pouzivatel $pouzivatel */
        $pouzivatel = auth()->user();

        return $this->response->item($pouzivatel, PouzivatelTransformer::class, ['key' => 'pouzivatel']);
    }
}
