Fixed app documentation loading

This commit is contained in:
frikky
2022-09-02 00:37:25 +02:00
parent 72bf8399b5
commit 2055c66630
3 changed files with 20 additions and 5 deletions
+7 -3
View File
@@ -398,8 +398,8 @@ const AngularWorkflow = (defaultprops) => {
},
});
const getAppDocs = (appname) => {
fetch(`${globalUrl}/api/v1/docs/${appname}?location=openapi`, {
const getAppDocs = (appname, location, version) => {
fetch(`${globalUrl}/api/v1/docs/${appname}?location=${location}&version=${version}`, {
headers: {
Accept: "application/json",
},
@@ -436,10 +436,14 @@ const AngularWorkflow = (defaultprops) => {
useEffect(() => {
if (authenticationModalOpen === true && selectedAction.app_name !== undefined) {
console.log(`Should get app docs for: ${selectedAction.app_name}`)
//console.log(selectedAction)
//console.log("APP: ", selectedApp)
if (selectedAction.documentation === undefined || selectedAction.documentation === null || selectedAction.documentation.length === 0) {
// SelectedApp.documentation = Markdown? If so, it works
getAppDocs(selectedAction.app_name)
//
const apptype = selectedApp.generated === false ? "python" : "openapi"
getAppDocs(selectedAction.app_name, apptype, selectedAction.app_version)
}
}
}, [authenticationModalOpen])