mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Added possibillity to delete attachments in admin page.
This commit is contained in:
parent
72cd9a3722
commit
7c43feefbe
10 changed files with 133 additions and 19 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue