fix: 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>
This commit is contained in:
Daniel Calviño Sánchez 2026-05-14 23:23:49 +02:00 committed by F. E Noel Nfebe
parent 35484a9e39
commit e1796a57e8
2 changed files with 4 additions and 1 deletions

View file

@ -1131,6 +1131,9 @@ export default {
// 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
this.share._share.id = share.id
// Similarly the token is always set by the backend when the
// share is created.
this.share._share.token = share.token
await this.queueUpdate(...permissionsAndAttributes)
// Also a ugly hack to update the updated permissions
for (const prop of permissionsAndAttributes) {

View file

@ -16,7 +16,7 @@
},
"apps/files_sharing/src/views/SharingDetailsTab.vue": {
"vue/no-mutating-props": {
"count": 23
"count": 24
}
},
"apps/files_sharing/src/views/SharingLinkList.vue": {