refs #2912. Bug when delete image permanent #84

Merged
maranda merged 1 commits from hotfix-delete-image into develop 2026-04-06 10:54:16 +02:00
1 changed files with 8 additions and 1 deletions

View File

@ -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()]);