feat(plugins/pagerduty): enforce PagerDutyEntity type from usePagerdutyEntity

Signed-off-by: Alec Jacobs <cajacobs5401@gmail.com>
This commit is contained in:
Alec Jacobs
2022-06-03 10:56:29 -07:00
parent 1b0ab05757
commit 05da90db84
2 changed files with 3 additions and 2 deletions
@@ -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 {
+2 -1
View File
@@ -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,