#112: Fixed too large param and frontend app creator bugs

This commit is contained in:
frikky
2020-08-16 09:29:51 +02:00
parent 3c6409a7f7
commit e3d75ede65
4 changed files with 13 additions and 14 deletions
+6 -7
View File
@@ -279,9 +279,9 @@ const AppCreator = (props) => {
return response.json()
})
.then((responseJson) => {
setIsAppLoaded(true)
if (!responseJson.success) {
alert.error("Failed to get the app")
setIsAppLoaded(true)
} else {
const data = JSON.parse(responseJson.body)
parseIncomingOpenapiData(data)
@@ -365,6 +365,8 @@ const AppCreator = (props) => {
var firstUrl = data.servers[0].url
if (firstUrl.endsWith("/")) {
setBaseUrl(firstUrl.slice(0, firstUrl.length-1))
} else {
setBaseUrl(firstUrl)
}
}
@@ -378,9 +380,6 @@ const AppCreator = (props) => {
securitySchemes = data.components.securitySchemes
}
console.log(data)
// FIXME - headers?
var newActions = []
var wordlist = {}
@@ -398,7 +397,6 @@ const AppCreator = (props) => {
"errors": [],
}
for (var key in methodvalue.parameters) {
const parameter = methodvalue.parameters[key]
if (parameter.in === "query") {
@@ -520,6 +518,7 @@ const AppCreator = (props) => {
}
setActions(newActions)
setIsAppLoaded(true)
}
// Saving the app that's been configured.
@@ -1590,12 +1589,12 @@ const AppCreator = (props) => {
style={{flex: "1", marginTop: "5px", marginRight: "15px", backgroundColor: inputColor}}
fullWidth={true}
type="name"
id="outlined-with-placeholder"
id="outlined-with-placeholder"
margin="normal"
variant="outlined"
placeholder="A description for the service"
value={description}
onChange={e => setDescription(e.target.value)}
onChange={e => setDescription(e.target.value)}
InputProps={{
classes: {
notchedOutline: classes.notchedOutline,