its 7am i havent slept i have no idea
This commit is contained in:
@@ -6,14 +6,14 @@ use App\Entity\Review;
|
||||
use App\Form\ReviewType;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Bundle\SecurityBundle\Attribute\IsGranted;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
/**
|
||||
* ReviewController funnels CRUD flows through album pages and simple routes.
|
||||
* ReviewController wires up CRUD routes for reviews and keeps users inside the album-focused flow.
|
||||
*/
|
||||
#[Route('/reviews')]
|
||||
class ReviewController extends AbstractController
|
||||
@@ -28,7 +28,7 @@ class ReviewController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirects users to the album flow when starting a review.
|
||||
* Nudges users back to the album flow so new reviews always start from a specific album.
|
||||
*/
|
||||
#[Route('/new', name: 'review_new', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('ROLE_USER')]
|
||||
@@ -43,7 +43,7 @@ class ReviewController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a standalone review page.
|
||||
* Shows a read-only page for a single review.
|
||||
*/
|
||||
#[Route('/{id}', name: 'review_show', requirements: ['id' => '\\d+'], methods: ['GET'])]
|
||||
public function show(Review $review): Response
|
||||
@@ -54,7 +54,7 @@ class ReviewController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles review form edits with authorization.
|
||||
* Handles review edits by running the voter, binding the form, and saving valid updates.
|
||||
*/
|
||||
#[Route('/{id}/edit', name: 'review_edit', requirements: ['id' => '\\d+'], methods: ['GET', 'POST'])]
|
||||
#[IsGranted('ROLE_USER')]
|
||||
@@ -78,7 +78,7 @@ class ReviewController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a review when the CSRF token and permission check pass.
|
||||
* Deletes a review after both the CSRF token and voter checks pass.
|
||||
*/
|
||||
#[Route('/{id}/delete', name: 'review_delete', requirements: ['id' => '\\d+'], methods: ['POST'])]
|
||||
#[IsGranted('ROLE_USER')]
|
||||
|
||||
Reference in New Issue
Block a user