fix: update attachments count when sharing

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2022-04-27 09:40:27 +02:00
committed by backportbot-nextcloud[bot]
parent 461ed6b81f
commit bfcd5357e3
3 changed files with 26 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ use OCA\Deck\Db\CardMapper;
use OCA\Deck\Db\User;
use OCA\Deck\NoPermissionException;
use OCA\Deck\Service\PermissionService;
use OCA\Deck\Service\AttachmentService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\AppFramework\Utility\ITimeFactory;
@@ -75,16 +76,29 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
private $cardMapper;
/** @var PermissionService */
private $permissionService;
/** @var AttachmentService */
private $attachmentService;
/** @var ITimeFactory */
private $timeFactory;
private $l;
public function __construct(IDBConnection $connection, IManager $shareManager, ISecureRandom $secureRandom, BoardMapper $boardMapper, CardMapper $cardMapper, PermissionService $permissionService, IL10N $l) {
public function __construct(
IDBConnection $connection,
IManager $shareManager,
ISecureRandom $secureRandom,
BoardMapper $boardMapper,
CardMapper $cardMapper,
AttachmentService $attachmentService,
PermissionService $permissionService,
IL10N $l
) {
$this->dbConnection = $connection;
$this->shareManager = $shareManager;
$this->boardMapper = $boardMapper;
$this->cardMapper = $cardMapper;
$this->attachmentService = $attachmentService;
$this->permissionService = $permissionService;
$this->l = $l;
$this->timeFactory = \OC::$server->get(ITimeFactory::class);
}
@@ -152,6 +166,8 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
);
$data = $this->getRawShare($shareId);
$this->attachmentService->count($cardId, true);
return $this->createShareObject($data);
}