From 5d92a6a7c9a6541d2d6380d42c75bef6cab8c803 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 12 May 2020 11:57:30 +0200 Subject: Fix the Talk verification When enabling or disabling Talk verification in mail shares the server expects also a new password to be set. As we always just update one property at a time this means the Talk verification was impossible to activate or deactivate. With this patch, we send the talk option AND the new password. If there is no new password, the Talk option is disabled (in mail shares; in link shares it is possible to enable or disable the video verification without changing the password). When we finally have descriptive text on ActionCheckbox'es we should definitely add some explanatory text for the user. Right now this is as good as it gets. We'll have to backport to 18. Signed-off-by: Christoph Wurst --- apps/files_sharing/src/mixins/ShareRequests.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'apps/files_sharing/src/mixins/ShareRequests.js') diff --git a/apps/files_sharing/src/mixins/ShareRequests.js b/apps/files_sharing/src/mixins/ShareRequests.js index bad59da6593..bdc9a566a17 100644 --- a/apps/files_sharing/src/mixins/ShareRequests.js +++ b/apps/files_sharing/src/mixins/ShareRequests.js @@ -88,17 +88,11 @@ export default { * Update a share * * @param {number} id share id - * @param {Object} data destructuring object - * @param {string} data.property property to update - * @param {any} data.value value to set + * @param {Object} properties key-value object of the properties to update */ - async updateShare(id, { property, value }) { + async updateShare(id, properties) { try { - // ocs api requires x-www-form-urlencoded - const data = new URLSearchParams() - data.append(property, value) - - const request = await axios.put(shareUrl + `/${id}`, { [property]: value }, headers) + const request = await axios.put(shareUrl + `/${id}`, properties, headers) if (!('ocs' in request.data)) { throw request } @@ -107,7 +101,7 @@ export default { console.error('Error while updating share', error) OC.Notification.showTemporary(t('files_sharing', 'Error updating the share'), { type: 'error' }) const message = error.response.data.ocs.meta.message - throw new Error(`${property}, ${message}`) + throw new Error(`${Object.keys(properties)}, ${message}`) } }, }, -- cgit v1.2.3