fix(files_sharing): Correctly reject pending remote shares

Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
provokateurin 2025-08-25 14:55:27 +02:00
parent 5ce2cf1c26
commit d2c37620f5
No known key found for this signature in database
3 changed files with 17 additions and 7 deletions

View file

@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long