Skip to content

Commit

Permalink
Getting app with slug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jgruica committed Aug 10, 2020
1 parent 90426f1 commit 7830ceb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kotsadm/web/src/components/apps/AppDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ class AppDetailPage extends Component {
}

getApp = async (slug = this.props.match.params.slug) => {
if (!this.props.match.params.slug) {
if (!slug) {
return;
}

try {
this.setState({ loadingApp: true, gettingAppErrMsg: "", displayErrorModal: false });

const res = await fetch(`${window.env.API_ENDPOINT}/apps/app/${this.props.match.params.slug}`, {
const res = await fetch(`${window.env.API_ENDPOINT}/apps/app/${slug}`, {
headers: {
"Authorization": Utilities.getToken(),
"Content-Type": "application/json",
Expand Down Expand Up @@ -410,7 +410,7 @@ class AppDetailPage extends Component {
errorModal={this.state.displayErrorModal}
toggleErrorModal={this.toggleErrorModal}
errMsg={gettingAppErrMsg}
tryAgain={this.getApp}
tryAgain={() => this.getApp(this.props.match.params.slug)}
err="Failed to get application"
loading={this.state.loadingApp}
/>}
Expand Down

0 comments on commit 7830ceb

Please sign in to comment.