Skip to content

Commit a23c087

Browse files
Merge pull request #54625 from nextcloud/fix/files_sharing/reject-pending-remote-share
2 parents a7a7805 + d4b0520 commit a23c087

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

apps/files_sharing/src/files_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

dist/files_sharing-init.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-init.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)