diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-07-01 17:26:00 +0200 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-07-27 12:19:18 +0200 |
commit | 53aafff972d14e09732f61809079e39d08a9cb3b (patch) | |
tree | dfe05ce2d0ed68c53d9b2b28450bba724c49727f /apps/files_sharing/js/app.js | |
parent | 702bced2b7db60f05a217ddb673360e85b3c3153 (diff) | |
download | nextcloud-server-53aafff972d14e09732f61809079e39d08a9cb3b.tar.gz nextcloud-server-53aafff972d14e09732f61809079e39d08a9cb3b.zip |
Extend pending shares list to include remote shares
And adjust the accept/decline actions to use the right endpoint for
remote shares.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/js/app.js')
-rw-r--r-- | apps/files_sharing/js/app.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js index 442d5bbeafe..6af8224baf4 100644 --- a/apps/files_sharing/js/app.js +++ b/apps/files_sharing/js/app.js @@ -296,7 +296,11 @@ OCA.Sharing.App = { type: OCA.Files.FileActions.TYPE_INLINE, actionHandler(fileName, context) { const shareId = context.$file.data('shareId') - $.post(OC.linkToOCS('apps/files_sharing/api/v1/shares/pending/{shareId}', { shareId })) + let shareBase = 'shares/pending' + if (context.$file.attr('data-remote-id')) { + shareBase = 'remote_shares/pending' + } + $.post(OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase + '/{shareId}', { shareBase, shareId })) .success(function(result) { context.fileList.remove(context.fileInfoModel.attributes.name) }).fail(function() { @@ -313,8 +317,13 @@ OCA.Sharing.App = { type: OCA.Files.FileActions.TYPE_INLINE, actionHandler(fileName, context) { const shareId = context.$file.data('shareId') + let shareBase = 'shares' + if (context.$file.attr('data-remote-id')) { + shareBase = 'remote_shares/pending' + } + $.ajax({ - url: OC.linkToOCS('apps/files_sharing/api/v1/shares/{shareId}', { shareId }), + url: OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase + '/{shareId}', { shareId }), type: 'DELETE', }).success(function(result) { context.fileList.remove(context.fileInfoModel.attributes.name) |