Skip to content

Fix two small bugs with the RestAPI Datasource #798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/util/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function saveDataAsFile({ data, filename, fileType, dataType }: Sav

if (dataType === "base64") {
const blob = new Blob([Buffer.from(data, "base64")], {
type: mime + ";charset=utf-16",
type: mim + ";charset=utf-16",
});
return saveAs(blob, filename, { autoBom: true });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ utils.downloadFile(query1.data, "users-data.xlsx")

// Example: Download the results of query1 as a XLXS file named users-data.
utils.downloadFile(restApiQuery.data, "users-data", {
fileType: "pdf",
fileType: "xlsx",
dataType: "base64",
})
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private ResponseBodyData parseResponseDataInfo(byte[] body, MediaType contentTyp
}
if (isBinary(contentType)) {
return ResponseBodyData.builder()
.body(Base64.getEncoder().encode(body))
.body(body)
.dataType(ResponseDataType.BINARY)
.build();
}
Expand Down