Skip to content

Commit 148ddb0

Browse files
committed
Fix error when creating mail shares if custom tokens are enabled
When a new share is saved it is first created in the backend and then updated with some additional attributes set in the frontend. If custom tokens are enabled the attributes to update also include the token. However, for new shares the token is set by the backend when it is created, it is not defined by the frontend, so the token returned by the backend needs to be copied to the share data in the frontend. Otherwise the update would fail because an empty token is sent. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 9579170 commit 148ddb0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,9 @@ export default {
11311131
11321132
// ugly hack to make code work - we need the id to be set but at the same time we need to keep values we want to update
11331133
this.share._share.id = share.id
1134+
// Similarly the token is always set by the backend when the
1135+
// share is created.
1136+
this.share._share.token = share.token
11341137
await this.queueUpdate(...permissionsAndAttributes)
11351138
// Also a ugly hack to update the updated permissions
11361139
for (const prop of permissionsAndAttributes) {

0 commit comments

Comments
 (0)