Cleaned up how keys are handled for duplicates and published workflows. Further changes APIs to use the correct one again for OpenAPI loading

This commit is contained in:
frikky
2022-10-27 18:00:04 +02:00
parent 4ca5fcfeb2
commit be0aed82e3
4 changed files with 41 additions and 34 deletions
+28 -27
View File
@@ -393,35 +393,36 @@ const AppCreator = (defaultprops) => {
return;
}
handleEditApp(urlParams.get("id"))
//handleEditApp(urlParams.get("id"))
//fetch(globalUrl + "/api/v1/get_openapi/" + urlParams.get("id"), {
// method: "GET",
// headers: {
// "Content-Type": "application/json",
// Accept: "application/json",
// },
// credentials: "include",
//})
// .then((response) => {
// if (response.status !== 200) {
// throw new Error("NOT 200 :O");
// }
// THIS has to stay due to ID may not exist as normal app yet
fetch(globalUrl + "/api/v1/get_openapi/" + urlParams.get("id"), {
method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
})
.then((response) => {
if (response.status !== 200) {
throw new Error("NOT 200 :O");
}
// return response.json();
// })
// .then((responseJson) => {
// setIsAppLoaded(true);
// if (!responseJson.success) {
// alert.error("Failed to verify");
// } else {
// parseIncomingOpenapiData(responseJson);
// }
// })
// .catch((error) => {
// console.log("Error: ", error.toString());
// alert.error(error.toString());
// });
return response.json();
})
.then((responseJson) => {
setIsAppLoaded(true);
if (!responseJson.success) {
alert.error("Failed to get app config. Do you have access?");
} else {
parseIncomingOpenapiData(responseJson);
}
})
.catch((error) => {
console.log("Error: ", error.toString());
alert.error(error.toString());
});
};
const setFileFromb64 = () => {