fix(files_sharing): adjust NewFileRequestDialog for emails invites

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
skjnldsv 2024-07-05 15:18:28 +02:00 committed by John Molakvoæ
parent 75ca4944c9
commit 06462804f7

View file

@ -238,18 +238,28 @@ export default defineComponent({
async createShare() {
this.loading = true
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1/shares')
// Format must be YYYY-MM-DD
const expireDate = this.deadline ? this.deadline.toISOString().split('T')[0] : undefined
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1/shares')
try {
const request = await axios.post(shareUrl, {
path: this.destination,
shareType: Type.SHARE_TYPE_EMAIL,
publicUpload: 'true',
label: this.label,
path: this.destination,
note: this.note,
password: this.password || undefined,
expireDate,
label: this.label,
attributes: JSON.stringify({ is_file_request: true })
// Empty string to fallback to the attributes
sharedWith: '',
attributes: JSON.stringify({
value: this.emails,
key: 'emails',
scope: 'sharedWith',
})
})
// If not an ocs request