Skip to content

Commit

Permalink
Fix artifact downloading (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
aryabokon committed Jun 24, 2024
1 parent 5b18381 commit 5f8506e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/src/frontend/components/ArtifactList/presenter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ function ArtifactLabel(props) {
}

<div className='artifact-label-right'>
<a href={`rest/api/3/artifacts/${id}/download`}
<a href={`rest/api/3/components/${selectedComponent}/versions/${selectedVersion}/artifacts/${id}/download`}
download={fileName}>
<Icon icon='import'/>
</a>
{isPrintable &&
<a href={`rest/api/3/artifacts/${id}/download`}
<a href={`rest/api/3/components/${selectedComponent}/versions/${selectedVersion}/artifacts/${id}/download`}
target="_blank" hidden={!isPrintable}>
<Icon icon='share'/>
</a>
Expand Down
2 changes: 1 addition & 1 deletion server/src/frontend/components/duck/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const getArtifactsList = (componentId, minorVersion, version) => (dispatch) => {

const getDocumentArtifact = (componentId, version, id, displayName) => (dispatch) => {
dispatch(actions.requestDocumentArtifact(id))
fetch(`rest/api/3/artifacts/${id}/download`).then((response) => {
fetch(`rest/api/3/components/${componentId}/versions/${version}/artifacts/${id}/download`).then((response) => {
response.text().then((data) => {
dispatch(actions.receiveDocumentArtifact(id, displayName, true, data))
})
Expand Down

0 comments on commit 5f8506e

Please sign in to comment.