Skip to content

Commit

Permalink
use post req
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Dec 10, 2023
1 parent ab84fb8 commit e88d3b1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/statistics/bot-statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,37 +371,36 @@ class BotStats extends LitElement {
async fetchBPMNModel(botName) {
document.getElementById("pm-res").querySelector("svg")?.remove();

const botManagerEndpointInput = this.configMap
.get("sbm-endpoint")
.toString();
const pm4botsEndpointInput = this.configMap
.get("pm4bots-endpoint")
.toString();
const eventLogEndpointInput = this.configMap
.get("event-log-endpoint")
.toString();

if (
!botManagerEndpointInput ||
!pm4botsEndpointInput ||
!eventLogEndpointInput
) {
const botModel = this.y.getMap("data").get("model");

if (!pm4botsEndpointInput || !eventLogEndpointInput) {
this.alertMessage =
"Make sure to configure the endpoints using the button on the top right";
return;
}
let url = joinAbsoluteUrlPath(pm4botsEndpointInput, "bot", botName, "bpmn");
url += `?bot-manager-url=${botManagerEndpointInput}`;
url += `&event-log-url=${eventLogEndpointInput}`;
url += `?event-log-url=${eventLogEndpointInput}`;
url += `&enhance=${true}`;

try {
const response = await fetch(url, {
method: "POST",
timeout: 10000,
headers: {
"Access-Control-Allow-Origin": "*",
Accept: "text/html",
"Content-Type": "application/json",
},
body: JSON.stringify({
"bot-model": botModel,
}),
});
if (!response.ok) {
try {
Expand Down

0 comments on commit e88d3b1

Please sign in to comment.