feat(plugins/pagerduty): enforce PagerDutyEntity type from usePagerdutyEntity
Signed-off-by: Alec Jacobs <cajacobs5401@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user