summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/mixins/SharesMixin.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/src/mixins/SharesMixin.js')
-rw-r--r--apps/files_sharing/src/mixins/SharesMixin.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js
index e19af48bc7e..72fec9e122b 100644
--- a/apps/files_sharing/src/mixins/SharesMixin.js
+++ b/apps/files_sharing/src/mixins/SharesMixin.js
@@ -224,31 +224,34 @@ export default {
/**
* Send an update of the share to the queue
*
- * @param {string} property the property to sync
+ * @param {string} propertyNames the properties to sync
*/
- queueUpdate(property) {
+ queueUpdate(...propertyNames) {
+ if (propertyNames.length === 0) {
+ // Nothing to update
+ return
+ }
+
if (this.share.id) {
+ const properties = {}
// force value to string because that is what our
// share api controller accepts
- const value = this.share[property].toString()
+ propertyNames.map(p => (properties[p] = this.share[p].toString()))
this.updateQueue.add(async() => {
this.saving = true
this.errors = {}
try {
- await this.updateShare(this.share.id, {
- property,
- value,
- })
+ await this.updateShare(this.share.id, properties)
// clear any previous errors
- this.$delete(this.errors, property)
+ this.$delete(this.errors, propertyNames[0])
// reset password state after sync
this.$delete(this.share, 'newPassword')
} catch ({ message }) {
if (message && message !== '') {
- this.onSyncError(property, message)
+ this.onSyncError(propertyNames[0], message)
}
} finally {
this.saving = false