Handling js upload files and displayling list of files by vue component.
This commit is contained in:
@@ -14,6 +14,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
use Techtube\Bookinfo\BookFinder;
|
||||
|
||||
#[Route('/book')]
|
||||
@@ -114,6 +115,13 @@ class BookController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/files', name: 'app_book_file', methods: ['GET'])]
|
||||
public function files(Book $book): JsonResponse
|
||||
{
|
||||
return $this->json($book->getFiles(), context: [AbstractNormalizer::IGNORED_ATTRIBUTES => ['book']]);
|
||||
}
|
||||
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_book_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(
|
||||
Request $request,
|
||||
|
||||
Reference in New Issue
Block a user