Skip to content

Commit

Permalink
Merge pull request #616 from oat-sa/hotfix/LSI-5002/fix-booklet-download
Browse files Browse the repository at this point in the history
fix: booklet download from tasks queue
  • Loading branch information
viktar-dzmitryieu-tao authored Dec 19, 2024
2 parents 48bbe0a + 17bcfe7 commit 6af3e5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-core-ui",
"version": "3.8.1",
"version": "3.8.2",
"displayName": "TAO Core UI",
"description": "UI libraries of TAO",
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions src/taskQueue/taskQueueModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,12 @@ export default function taskQueueModel(config) {
throw new TypeError('config.url.download is not configured while download() is being called');
}

return this.getCached(taskId).then(function (taskData) {
let redirectUrl = (taskData || {}).redirectUrl;
return this.getCached(taskId).then(function (taskData = {}) {
const { redirectUrl, category } = taskData;

if (redirectUrl) {
// if the task is an update task, we should not use redirectUrl for download
// it only uses for DOCX file download (export category)
if (redirectUrl && category !== 'update') {
return new Promise(function (resolve) {
$.fileDownload(redirectUrl, {
httpMethod: 'GET',
Expand Down

0 comments on commit 6af3e5a

Please sign in to comment.