Skip to content

Commit cce1dd2

Browse files
committed
assert that we have a File after Blobs may be passed in, too
1 parent 0b97bde commit cce1dd2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/seed-transform-rest.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ export class SeedTransformREST extends SeedTransformer {
6464
systemId = undefined;
6565
}
6666
const api = WorkaroundApiFactory(this.getConfiguration());
67-
const response = await api.transformTransformationPost(this.transformation, this.src, systemId, params, {});
67+
68+
// assert that we have a File object
69+
var source: File;
70+
if (this.src instanceof Blob) {
71+
source = new File([this.src], systemId ?? "uploaded");
72+
} else {
73+
source = this.src;
74+
}
75+
76+
const response = await api.transformTransformationPost(this.transformation, source, systemId, params, {});
6877
console.log(response);
6978
this._result = response.data;
7079
this._mediaType = response?.headers?.["content-type"];

0 commit comments

Comments
 (0)