Add 1.1 api version to handle other attachment types properly

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2021-01-04 15:27:48 +01:00
parent 8ab7019693
commit 199cccf86b
10 changed files with 232 additions and 142 deletions

View File

@@ -380,7 +380,7 @@ class ActivityManager {
case self::SUBJECT_ATTACHMENT_UPDATE:
case self::SUBJECT_ATTACHMENT_DELETE:
case self::SUBJECT_ATTACHMENT_RESTORE:
$subjectParams = $this->findDetailsForAttachment($entity->getId());
$subjectParams = $this->findDetailsForAttachment($entity);
break;
case self::SUBJECT_BOARD_SHARE:
case self::SUBJECT_BOARD_UNSHARE:
@@ -527,8 +527,7 @@ class ActivityManager {
];
}
private function findDetailsForAttachment($attachmentId) {
$attachment = $this->attachmentMapper->find($attachmentId);
private function findDetailsForAttachment($attachment) {
$data = $this->findDetailsForCard($attachment->getCardId());
return array_merge($data, ['attachment' => $attachment]);
}