diff options
author | Robin Appelman <robin@icewind.nl> | 2023-05-15 13:03:13 +0200 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2023-05-24 14:14:36 +0000 |
commit | bf6071608e45b755daf1c87a835e95512d3c5296 (patch) | |
tree | 030d81eb8d4d1d3822ccbd3d0cc2aa38515cc70f /apps/files_sharing | |
parent | 713b9603a4e36a41efa0cd2c0ba88e4fa6ab893f (diff) | |
download | nextcloud-server-bf6071608e45b755daf1c87a835e95512d3c5296.tar.gz nextcloud-server-bf6071608e45b755daf1c87a835e95512d3c5296.zip |
reload filelist when adding or removing shares
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/src/mixins/ShareRequests.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_sharing/src/mixins/ShareRequests.js b/apps/files_sharing/src/mixins/ShareRequests.js index 4218eecc485..e1d246b7400 100644 --- a/apps/files_sharing/src/mixins/ShareRequests.js +++ b/apps/files_sharing/src/mixins/ShareRequests.js @@ -29,6 +29,7 @@ import 'url-search-params-polyfill' import { generateOcsUrl } from '@nextcloud/router' import axios from '@nextcloud/axios' import Share from '../models/Share.js' +import { emit } from '@nextcloud/event-bus' const shareUrl = generateOcsUrl('apps/files_sharing/api/v1/shares') @@ -57,7 +58,9 @@ export default { if (!request?.data?.ocs) { throw request } - return new Share(request.data.ocs.data) + const share = new Share(request.data.ocs.data) + emit('files_sharing:share:created', { share }) + return share } catch (error) { console.error('Error while creating share', error) const errorMessage = error?.response?.data?.ocs?.meta?.message @@ -81,6 +84,7 @@ export default { if (!request?.data?.ocs) { throw request } + emit('files_sharing:share:deleted', { id }) return true } catch (error) { console.error('Error while deleting share', error) @@ -102,6 +106,7 @@ export default { async updateShare(id, properties) { try { const request = await axios.put(shareUrl + `/${id}`, properties) + emit('files_sharing:share:updated', { id }) if (!request?.data?.ocs) { throw request } else { |