Skip to content

Commit

Permalink
Merge pull request #178 from celonis/TA-NN-fix-datamodel-push
Browse files Browse the repository at this point in the history
TA-2896: Send body as FormData on dataModel push
  • Loading branch information
LaberionAjvazi authored Mar 11, 2024
2 parents 6ef9485 + 14add3d commit 5cb44be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celonis/content-cli",
"version": "0.8.0",
"version": "0.8.1",
"description": "CLI Tool to help manage content in Celonis EMS",
"main": "content-cli.js",
"bin": {
Expand Down
19 changes: 9 additions & 10 deletions src/content/manager/ctp.datamodel.manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CtpManager } from "./ctp.manager";
import * as FormData from "form-data";

export class CtpDataModelManager extends CtpManager {
private static BASE_URL = "/cpm-ems-migrator/migration/api/ctp";
Expand All @@ -16,15 +17,13 @@ export class CtpDataModelManager extends CtpManager {
}

protected getBody(): object {
return {
formData: {
file: this.content,
transport: JSON.stringify({
password: this.password,
existingPoolId: this.existingPoolId,
globalPoolName: this.globalPoolName,
}),
},
};
const formData = new FormData();
formData.append("file", this.content);
formData.append("transport", JSON.stringify({
password: this.password,
existingPoolId: this.existingPoolId,
globalPoolName: this.globalPoolName,
}));
return formData;
}
}

0 comments on commit 5cb44be

Please sign in to comment.