diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-05-12 11:57:30 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-06-01 17:21:42 +0200 |
commit | 5d92a6a7c9a6541d2d6380d42c75bef6cab8c803 (patch) | |
tree | b0eb92be095921d31a25c29fa266a09f7fd77b2e /apps/files_sharing/src/mixins/ShareRequests.js | |
parent | 0f4de3d3533606e20ca4ff035f6eaf9c27bcac4a (diff) | |
download | nextcloud-server-5d92a6a7c9a6541d2d6380d42c75bef6cab8c803.tar.gz nextcloud-server-5d92a6a7c9a6541d2d6380d42c75bef6cab8c803.zip |
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 <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_sharing/src/mixins/ShareRequests.js')
-rw-r--r-- | apps/files_sharing/src/mixins/ShareRequests.js | 14 |
1 files changed, 4 insertions, 10 deletions
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}`) } }, }, |