|
|
@ -56,11 +56,12 @@ class ExerciseDisplay extends Component{
|
|
|
|
const url = `/${this.props.urlPath || 'exercises'}/${Id}.json`
|
|
|
|
const url = `/${this.props.urlPath || 'exercises'}/${Id}.json`
|
|
|
|
axios.get(url)
|
|
|
|
axios.get(url)
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
if (response.data.exercise) {
|
|
|
|
response.data.exercise_description = response.data.exercise_description || response.data.description
|
|
|
|
response.data.exercise.exercise_description = response.data.exercise.exercise_description || response.data.exercise.description
|
|
|
|
response.data.exercise_name = response.data.exercise_name || response.data.name
|
|
|
|
response.data.exercise.exercise_name = response.data.exercise.exercise_name || response.data.exercise.name
|
|
|
|
response.data.exercise_status = response.data.exercise_status == undefined ? 1 : response.data.exercise_status
|
|
|
|
response.data.exercise.exercise_status = response.data.exercise.exercise_status == undefined ? 1 : response.data.exercise.exercise_status
|
|
|
|
this.setState({...response.data})
|
|
|
|
this.setState({...response.data})
|
|
|
|
|
|
|
|
this.props.detailFetchCallback && this.props.detailFetchCallback(response);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(function (error) {
|
|
|
|
.catch(function (error) {
|
|
|
|