fix(editor): Fix viewing and downloading of binary data (#6218)

NODE-525
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-05-10 11:45:29 +00:00 committed by GitHub
parent d5e62ff096
commit b9779c3293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1227,7 +1227,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
return makeRestApiRequest(rootStore.getRestApiContext, 'GET', '/eventbus/execution/' + id);
},
// Binary data
async getBinaryUrl(dataPath, mode, fileName, mimeType): string {
getBinaryUrl(
dataPath: string,
mode: 'view' | 'download',
fileName: string,
mimeType: string,
): string {
const rootStore = useRootStore();
let restUrl = rootStore.getRestUrl;
if (restUrl.startsWith('/')) restUrl = window.location.origin + restUrl;