WIP: Implement uploads
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller\Upload;
|
||||
|
||||
use App\Service\Upload\UploadHandler;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class DeleteController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly UploadHandler $uploadHandler)
|
||||
{}
|
||||
|
||||
#[Route('/upload/delete', name: 'app_upload_delete', methods: ['DELETE'])]
|
||||
#[IsGranted('ROLE_USER')]
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$uuid = $request->get('uuid');
|
||||
|
||||
$this->uploadHandler->removeUploadFromSession($uuid);
|
||||
|
||||
return $this->json([
|
||||
'success' => true,
|
||||
'uuid' => $uuid,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user