mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-06 23:39:51 +01:00
Added possibillity to delete attachments in admin page.
This commit is contained in:
@@ -73,6 +73,8 @@ class EntityURLGenerator
|
||||
case 'list':
|
||||
case 'list_parts':
|
||||
return $this->listPartsURL($entity);
|
||||
case 'delete':
|
||||
return $this->deleteURL($entity);
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Method is not supported!');
|
||||
@@ -169,6 +171,15 @@ class EntityURLGenerator
|
||||
|
||||
}
|
||||
|
||||
public function deleteURL($entity) : string
|
||||
{
|
||||
if($entity instanceof AttachmentType) {
|
||||
return $this->urlGenerator->generate('attachment_type_delete', ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
throw new EntityNotSupported('The given entity is not supported yet!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an HTML link to the info page about the given entity.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user