Skip to content

Commit be93c6e

Browse files
provokateurinbackportbot[bot]
authored andcommitted
fix(files_sharing): Correctly reject pending remote shares
Signed-off-by: provokateurin <[email protected]> [skip ci]
1 parent 63ae220 commit be93c6e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

apps/files_sharing/src/actions/rejectShareAction.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,20 @@ export const action = new FileAction({
4141
async exec(node: Node) {
4242
try {
4343
const isRemote = !!node.attributes.remote
44-
const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/{id}', {
45-
shareBase: isRemote ? 'remote_shares' : 'shares',
46-
id: node.attributes.id,
47-
})
44+
const shareBase = isRemote ? 'remote_shares' : 'shares'
45+
const id = node.attributes.id
46+
let url: string
47+
if (node.attributes.accepted === 0) {
48+
url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/pending/{id}', {
49+
shareBase,
50+
id,
51+
})
52+
} else {
53+
url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/{id}', {
54+
shareBase,
55+
id,
56+
})
57+
}
4858
await axios.delete(url)
4959

5060
// Remove from current view

0 commit comments

Comments
 (0)