Skip to content

Commit

Permalink
Fix download when file is in folder
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikhellgren committed Apr 25, 2024
1 parent f11e6d6 commit 29b6e8e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,14 @@ export class DownloadSelectedItemsButtonComponent extends React.Component<IExpor
"Content-Type": "application/json"
},
body: JSON.stringify({
"parameters":{"RenderOptions":4103}
"parameters":{
"RenderOptions":4103,
"ViewXml": `<View Scope="RecursiveAll"><Query><Where><Eq><FieldRef Name="UniqueId" /><Value Type="Guid">${item["NormUniqueID"]}</Value></Eq></Where></Query></View>`
}
})
};

return this.props.webPartContext.spHttpClient.post(`${item["SPWebUrl"]}/_api/web/lists/GetById('${item["NormListID"]}')/RenderListDataAsStream?FilterField1=UniqueId&FilterValue1=${item["NormUniqueID"]}`, SPHttpClient.configurations.v1, spOptions1)
return this.props.webPartContext.spHttpClient.post(`${item["SPWebUrl"]}/_api/web/lists/GetById('${item["NormListID"]}')/RenderListDataAsStream`, SPHttpClient.configurations.v1, spOptions1)
.then((response: SPHttpClientResponse) => {
return response.json()
});
Expand Down

0 comments on commit 29b6e8e

Please sign in to comment.