Skip to content
Snippets Groups Projects

CE-2076: Convert useHost to common

Merged CE-2076: Convert useHost to common
1 unresolved thread
Merged Alexander Madsen requested to merge CE-2076-convert-useHost into develop
1 unresolved thread

Ticket: CE-2076

Convert useHost hook to common and remove from SwaggerApi file

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
5 4 import { onFetchEntityError } from "../../components/common/Helper";
6 5 import NotFoundView from "../../components/navigation/NotFoundView/NotFoundView";
6 import { apiContext } from "../../api/DeployApi";
7 import { useAPIMethod } from "@ess-ics/ce-ui-common";
7 8
8 9 export function HostDetailsContainer({ id }) {
9 const [notFoundError, setNotFoundError] = useState();
10 const [host] = useHost(id, (m, s) => {
11 // handle error code 404, and define custom message on the UI because BE sends back generic error message
12 onFetchEntityError(m, s, setNotFoundError);
10 const [error, setError] = useState(null);
11 const client = useContext(apiContext);
12
13 const { value: host, error: fetchError } = useAPIMethod({
14 fcn: client.apis.Hosts.findHostById,
15 params: useMemo(() => ({ host_csentry_id: id }), [id])
  • Christina Jenks approved this merge request

    approved this merge request

  • Aside from my comment on code, the visual review looks good :thumbsup: ; didn't see any infinite requests or anything odd, seems to work as before.

  • Alexander Madsen added 7 commits

    added 7 commits

    Compare with previous version

  • added 1 commit

    • 5b921593 - Remove useHost from SwaggerApi file

    Compare with previous version

  • Christina Jenks approved this merge request

    approved this merge request

  • added 1 commit

    Compare with previous version

  • Alexander Madsen mentioned in commit 374b4101

    mentioned in commit 374b4101

  • Please register or sign in to reply
    Loading