refs #2912. Bug when delete image permanent
parent
8e6801eaa8
commit
86e12df20c
|
|
@ -6,6 +6,7 @@ use App\Controller\OgRepository\AbstractOgRepositoryController;
|
|||
use App\Entity\Image;
|
||||
use App\Entity\ImageImageRepository;
|
||||
use App\Entity\ImageRepository;
|
||||
use App\Model\ImageStatus;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
|
|
@ -38,7 +39,13 @@ class DeletePermanentAction extends AbstractOgRepositoryController
|
|||
|
||||
$repository = $data->getRepository();
|
||||
|
||||
$content = $this->createRequest( 'DELETE', 'http://'.$repository->getIp().':8006/ogrepository/v1/images/'.$data->getImageFullsum().'?method=permanent');
|
||||
if ($data->getStatus() === ImageStatus::TRASH) {
|
||||
$url = 'http://'.$repository->getIp().':8006/ogrepository/v1/trash/images/'.$data->getImageFullsum();
|
||||
} else {
|
||||
$url = 'http://'.$repository->getIp().':8006/ogrepository/v1/images/'.$data->getImageFullsum().'?method=permanent';
|
||||
}
|
||||
|
||||
$content = $this->createRequest('DELETE', $url);
|
||||
|
||||
$this->logger->info('Image deleted', ['image' => $image->getName()]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue