Skip to content

Commit

Permalink
feat: Save file to LibeSign every when a new file is uploaded
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Nov 5, 2024
1 parent 454b8d3 commit f46ee43
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/Controller/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use OCA\Files_Sharing\SharedStorage;
use OCA\Libresign\AppInfo\Application;
use OCA\Libresign\Db\File as FileEntity;
use OCA\Libresign\Db\SignRequestMapper;
use OCA\Libresign\Exception\LibresignException;
use OCA\Libresign\Helper\JSActions;
Expand All @@ -19,6 +20,7 @@
use OCA\Libresign\Service\AccountService;
use OCA\Libresign\Service\FileService;
use OCA\Libresign\Service\IdentifyMethodService;
use OCA\Libresign\Service\RequestSignatureService;
use OCA\Libresign\Service\SessionService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
Expand Down Expand Up @@ -59,6 +61,7 @@ public function __construct(
private SessionService $sessionService,
private SignRequestMapper $signRequestMapper,
private IdentifyMethodService $identifyMethodService,
private RequestSignatureService $requestSignatureService,
private AccountService $accountService,
private IRootFolder $root,
private IPreview $preview,
Expand Down Expand Up @@ -370,6 +373,15 @@ public function save(array $file, string $name = '', array $settings = []): Data
'file' => $file,
'settings' => $settings
]);
$data = [
'file' => [
'fileNode' => $node,
],
'name' => $name,
'userManager' => $this->userSession->getUser(),
'status' => FileEntity::STATUS_DRAFT,
];
$file = $this->requestSignatureService->save($data);

return new DataResponse(
[
Expand Down

0 comments on commit f46ee43

Please sign in to comment.