<?php

namespace Eater\Glim\Handler\Panel\Servers;

use Eater\Glim\Handler\Session;
use Eater\Glim\Model\ServerQuery;
use Eater\Glim\Service\CA;
use Eater\Glim\Service\Server;
use Symfony\Component\Config\Definition\Exception\Exception;

class Remove extends Session
{
    protected $shouldHaveSuperuser = true;

    public function handle()
    {
        $server = ServerQuery::create()->findOneByFingerprint($this->post('fingerprint'));
        $server->delete();

        return $this->json([
            'success' => true
        ]);
    }
}