Pārlūkot izejas kodu

Recalculate example value when requestBody value changes

bubble
Kyle Shockey pirms 6 gadiem
vecāks
revīzija
200b361328
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. +7
    -0
      src/core/plugins/oas3/components/request-body-editor.jsx

+ 7
- 0
src/core/plugins/oas3/components/request-body-editor.jsx Parādīt failu

@@ -48,6 +48,13 @@ export default class RequestBodyEditor extends PureComponent {
}
}

componentDidUpdate(prevProps) {
if(this.props.requestBody !== prevProps.requestBody) {
// force recalc of value if the request body definition has changed
this.setValueToSample(this.props.mediaType)
}
}

setValueToSample = (explicitMediaType) => {
this.onChange(this.sample(explicitMediaType))
}


Notiek ielāde…
Atcelt
Saglabāt