WIP: Implement uploads

This commit is contained in:
Björn Fromme
2023-09-18 17:56:33 +02:00
parent ce97017ac4
commit d6687c3ca4
51 changed files with 1123 additions and 168 deletions
@@ -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,
]);
}
}