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-22 13:22:52 +0000 |
commit | 8de29843497efed3eff05db1f90a15937d0a504c (patch) | |
tree | 01d565a68b15e4bb026cd850c36913ae0612dc39 /apps/files_sharing/src | |
parent | b313e2a507776141c320af06bd3369e188bc59b8 (diff) | |
download | nextcloud-server-8de29843497efed3eff05db1f90a15937d0a504c.tar.gz nextcloud-server-8de29843497efed3eff05db1f90a15937d0a504c.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/src')
-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 { |