diff --git a/frontend/src/pages/user/messages/Home.vue b/frontend/src/pages/user/messages/Home.vue index 93ed3c6..d2f7a12 100644 --- a/frontend/src/pages/user/messages/Home.vue +++ b/frontend/src/pages/user/messages/Home.vue @@ -91,8 +91,7 @@ export default { conversations(n_val) { console.log('nval', n_val, this.selConversation, n_val[0]?.messages) if (!this.selConversation && n_val[0]) { - this.selConversation = n_val[0] - this.messages = n_val[0].messages || [] + this.selectConversation(n_val[0]) this.clearUnreadMessageBy(n_val[0]) } else { if (n_val?.[0] && this.selConversation?.id === n_val?.[0]?.id) { diff --git a/frontend/src/pages/user/requests/Home.vue b/frontend/src/pages/user/requests/Home.vue index 4277a66..9d1807f 100644 --- a/frontend/src/pages/user/requests/Home.vue +++ b/frontend/src/pages/user/requests/Home.vue @@ -96,7 +96,7 @@ @@ -279,25 +279,37 @@ export default { }) }, downloadAttachedFile(request_id, document_id) { - WorksapceApi.fetchAttachedFileAsDownload(request_id, document_id) - .then((response) => { - // create file link in browser's memory - const href = URL.createObjectURL(response.data) - // create "a" HTML element with href to file & click - const link = document.createElement('a') - link.href = href - link.setAttribute('download', 'file.pdf') //or any other extension - document.body.appendChild(link) - link.click() + window.open(`http://${window.location.host}/api/workspace/request/fetch-attached-file-as-download?request_id=${request_id}&document_id=${document_id}`) - // clean up "a" element & remove ObjectURL - document.body.removeChild(link) - URL.revokeObjectURL(href) //TODO: navigate to the preview page - }) - .catch((error) => { - this.mnx_backendErrorHandler(error) - }) + // const link = document.createElement('a') + // link.href = `${window.location.host}/api/workspace/request/fetch-attached-file-as-download?request_id=${request_id}&document_id=${document_id}` + // link.download = file_name + // link.target = '_blank' + // document.body.appendChild(link) + // link.click() + // document.body.removeChild(link) + + // WorksapceApi.fetchAttachedFileAsDownload(request_id, document_id) + // .then((response) => { + // // create file link in browser's memory + // const href = URL.createObjectURL(response.data) + + // // create "a" HTML element with href to file & click + // const link = document.createElement('a') + // link.href = href + // link.setAttribute('download', 'file.pdf') //or any other extension + // link.setAttribute('_') + // document.body.appendChild(link) + // link.click() + + // // clean up "a" element & remove ObjectURL + // document.body.removeChild(link) + // URL.revokeObjectURL(href) //TODO: navigate to the preview page + // }) + // .catch((error) => { + // this.mnx_backendErrorHandler(error) + // }) } } }