diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx index 2edc8cbd44..e089cf817c 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx @@ -86,7 +86,7 @@ export const PagerDutyCard = () => { foundService = services[0]; if (!foundService) throw new NotFoundError(); } else { - foundService = await api.getServiceByServiceId(serviceId); + foundService = await api.getServiceByServiceId(serviceId!); } return { diff --git a/plugins/pagerduty/src/hooks/index.ts b/plugins/pagerduty/src/hooks/index.ts index a5fa462e02..503597a69e 100644 --- a/plugins/pagerduty/src/hooks/index.ts +++ b/plugins/pagerduty/src/hooks/index.ts @@ -15,13 +15,14 @@ */ import { useEntity } from '@backstage/plugin-catalog-react'; +import { PagerDutyEntity } from '../types'; import { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID, } from '../components/constants'; -export function usePagerdutyEntity() { +export function usePagerdutyEntity(): PagerDutyEntity { const { entity } = useEntity(); const { [PAGERDUTY_INTEGRATION_KEY]: integrationKey,