<?php

namespace LaraBB\Profile\Actions\Admin;

use LaraBB\Profile\UI\Web\Requests\Admin\Edit;
use LaraBB\User\Tasks\FindTask as FindUserTask;

/**
 * Class EditAction
 * @package LaraBB\Profile\Actions\Admin
 */
class EditAction
{
    /**
     * EditAction constructor.
     * @param FindUserTask $findUserTask
     */
    public function __construct(private readonly FindUserTask $findUserTask)
    {
    }

    /**
     * @param Edit $request
     * @return mixed|null
     */
    public function run(Edit $request)
    {
        return $this->findUserTask->byUuid($request->route('uuid'), ['profile']);
    }
}
