mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-22 19:31:32 +00:00
Fix formatting
This commit is contained in:
parent
334a37a9d0
commit
26ee564481
2 changed files with 16 additions and 16 deletions
|
|
@ -137,18 +137,18 @@ implode(',', array_map(static fn (PartLot $lot) => $lot->getID(), $part->getPart
|
|||
$this->denyAccessUnlessGranted('edit', $part);
|
||||
|
||||
switch ($action) {
|
||||
case "add_tag":
|
||||
case "add_tag":
|
||||
$this->denyAccessUnlessGranted('edit', $part);
|
||||
$tags = $part->getTags();
|
||||
$tags = $part->getTags();
|
||||
$part->setTags($tags . ',' . $target_id); // simple append
|
||||
break;
|
||||
case "remove_tag":
|
||||
break;
|
||||
case "remove_tag":
|
||||
$this->denyAccessUnlessGranted('edit', $part);
|
||||
$tags = $part->getTags();
|
||||
$tags = str_replace($target_id, '', $tags);
|
||||
// sanitize $tags (remove leading, trailing and double commas)
|
||||
$tags = $part->getTags();
|
||||
$tags = str_replace($target_id, '', $tags);
|
||||
// sanitize $tags (remove leading, trailing and double commas)
|
||||
$part->setTags($tags);
|
||||
break;
|
||||
break;
|
||||
case 'favorite':
|
||||
$this->denyAccessUnlessGranted('change_favorite', $part);
|
||||
$part->setFavorite(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue