Skip to content

Commit 68538d8

Browse files
committed
refactor(api): unify envelope response structure
Remove redundant 'envelope' field from API response. Now returns only the 'files' array with complete file information (id, uuid, name, status, statusText) for cleaner and more consistent API structure. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 2c86c25 commit 68538d8

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

lib/Db/SignRequestMapper.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -666,19 +666,13 @@ private function formatListRow(array $row): array {
666666

667667
if ($row['node_type'] === 'envelope') {
668668
$childrenFiles = $this->fileMapper->getChildrenFiles($internalId);
669-
$filesData = array_map(fn ($file) => [
669+
$row['files'] = array_map(fn ($file) => [
670670
'id' => $file->getNodeId(),
671671
'uuid' => $file->getUuid(),
672672
'name' => $file->getName(),
673673
'status' => $file->getStatus(),
674674
'statusText' => $this->fileMapper->getTextOfStatus($file->getStatus()),
675675
], $childrenFiles);
676-
677-
$row['envelope'] = [
678-
'filesCount' => count($childrenFiles),
679-
'files' => $filesData,
680-
];
681-
$row['files'] = $filesData;
682676
} else {
683677
$row['files'] = [[
684678
'id' => (int)$row['node_id'],

0 commit comments

Comments
 (0)