Skip to content

Commit b9deb66

Browse files
committed
fix(api): return internal LibreSign id in upload/envelope response
Ensure uid=1000(username) gid=1000(username) groups=1000(username),4(adm),24(cdrom),27(sudo),30(dip),44(video),46(plugdev),100(users),102(input),105(render),119(lpadmin),129(sambashare),994(docker),995(adbusers) in FileController::formatFileResponse uses the internal LibreSign file ID, not Nextcloud . Aligns backend contract with UI and API consumers. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 88b2a89 commit b9deb66

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

lib/Controller/FileController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ private function saveFiles(array $files, string $name, array $settings): DataRes
657657
private function formatFileResponse(FileEntity $mainEntity, array $childFiles): DataResponse {
658658
$response = [
659659
'message' => $this->l10n->t('Success'),
660-
'id' => $mainEntity->getNodeId(),
660+
'id' => $mainEntity->getId(),
661661
'nodeId' => $mainEntity->getNodeId(),
662662
'uuid' => $mainEntity->getUuid(),
663663
'name' => $mainEntity->getName(),

src/Components/RightSidebar/EnvelopeFilesList.vue

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,11 @@ export default {
186186
envelope() {
187187
return this.filesStore.getFile()
188188
},
189-
envelopeFileId() {
190-
const envelope = this.envelope || {}
191-
return envelope.id ?? envelope.fileId ?? null
192-
},
193189
envelopeUuid() {
194-
return this.envelope?.uuid || ''
190+
return this.envelope.uuid
195191
},
196192
envelopeId() {
197-
return this.envelope?.id || null
193+
return this.envelope.id
198194
},
199195
canDelete() {
200196
return this.envelope?.status === SIGN_STATUS.DRAFT && this.files.length >= 1
@@ -256,8 +252,7 @@ export default {
256252
},
257253
methods: {
258254
async loadFiles(page = 1) {
259-
if (!this.envelopeFileId) {
260-
console.error('EnvelopeFilesList - No envelopeFileId found!')
255+
if (!this.envelopeId) {
261256
return
262257
}
263258
@@ -270,9 +265,9 @@ export default {
270265
271266
const url = generateOcsUrl('/apps/libresign/api/v1/file/list')
272267
const params = new URLSearchParams({
273-
page: page.toString(),
274-
length: '50',
275-
parentFileId: this.envelopeFileId.toString(),
268+
page: page,
269+
length: 50,
270+
parentFileId: this.envelopeId,
276271
})
277272
278273
await axios.get(`${url}?${params.toString()}`)

0 commit comments

Comments
 (0)