bug fix in sell controller

This commit is contained in:
Hesabix 2024-02-11 13:24:19 +00:00
parent 83aed97247
commit b2c410f85a
2 changed files with 20 additions and 2 deletions

View file

@ -0,0 +1,18 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class MoadiyanController extends AbstractController
{
#[Route('api/moadiyan', name: 'app_moadiyan')]
public function index(): Response
{
return $this->render('moadiyan/index.html.twig', [
'controller_name' => 'MoadiyanController',
]);
}
}

View file

@ -20,7 +20,7 @@ class SellController extends AbstractController
public function app_buy_can_edit(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager, string $code): JsonResponse
{
$canEdit = true;
$acc = $access->hasRole('buy');
$acc = $access->hasRole('sell');
if(!$acc)
throw $this->createAccessDeniedException();
@ -44,7 +44,7 @@ class SellController extends AbstractController
#[Route('/api/sell/get/info/{code}', name: 'app_buy_get_info')]
public function app_buy_get_info(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager, string $code): JsonResponse
{
$acc = $access->hasRole('buy');
$acc = $access->hasRole('sell');
if(!$acc)
throw $this->createAccessDeniedException();
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([