fix: merge conflicts

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2022-12-20 21:34:10 +01:00
parent 67adda5f84
commit 21c4955001
4 changed files with 34 additions and 4 deletions

View File

@@ -27,13 +27,16 @@ use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCA\Deck\Service\AttachmentService;
use OCA\Deck\Db\AttachmentMapper;
class AttachmentApiController extends ApiController {
private $attachmentService;
private $attachmentMapper;
public function __construct($appName, IRequest $request, AttachmentService $attachmentService) {
public function __construct($appName, IRequest $request, AttachmentService $attachmentService, AttachmentMapper $attachmentMapper) {
parent::__construct($appName, $request);
$this->attachmentService = $attachmentService;
$this->attachmentMapper = $attachmentMapper;
}
/**
@@ -49,6 +52,13 @@ class AttachmentApiController extends ApiController {
return $attachment->getType() === 'deck_file';
});
}
if ($apiVersion === '1.2') {
foreach ($attachment as &$attachment) {
$this->attachmentMapper->mapOwner($attachment);
}
}
return new DataResponse($attachment, HTTP::STATUS_OK);
}