Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions apps/files_sharing/src/actions/rejectShareAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ export const action = new FileAction({
async exec(node: Node) {
try {
const isRemote = !!node.attributes.remote
const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/{id}', {
shareBase: isRemote ? 'remote_shares' : 'shares',
id: node.attributes.id,
})
const shareBase = isRemote ? 'remote_shares' : 'shares'
const id = node.attributes.id
let url: string
if (node.attributes.accepted === 0) {
url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/pending/{id}', {
shareBase,
id,
})
} else {
url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/{id}', {
shareBase,
id,
})
}
await axios.delete(url)

// Remove from current view
Expand Down
Loading
Loading