Skip to content

Commit

Permalink
fix: delete status pages service item
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramk committed Oct 29, 2023
1 parent 1d2457e commit b9a7196
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/configure/custom-hostnames.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class CustomHostNames extends React.PureComponent {
sizeType={Button.SIZE_TYPE.SMALL}
iconType={Button.ICON_TYPE.INTERFACE__SIGN__TIMES}
onClick={() => {
deleteHostNameCallback(hostNameObject.hostName);
deleteHostNameCallback(hostNameObject.id);
}}
>
Delete
Expand Down
6 changes: 3 additions & 3 deletions nerdlets/status-page-dashboard/main-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ export default class StatusPagesDashboard extends React.PureComponent {
};

deleteHostName = async () => {
const hostNameText = this.state.tileToBeDeleted;
const hostId = this.state.tileToBeDeleted;
const { hostNames } = this.state;
hostNames.splice(
hostNames.findIndex((val) => val.hostName === hostNameText),
hostNames.findIndex((val) => val.hostName === hostId),
1
);
const { deleteTileModalActive } = this.state;
Expand Down Expand Up @@ -502,7 +502,7 @@ export default class StatusPagesDashboard extends React.PureComponent {
const { deleteTileModalActive } = this.state;
this.setState({
deleteTileModalActive: !deleteTileModalActive,
tileToBeDeleted: hostname.hostName,
tileToBeDeleted: hostname.id,
});
};

Expand Down

0 comments on commit b9a7196

Please sign in to comment.