diff --git a/src/modules/service-detail/components/ServiceDetail.tsx b/src/modules/service-detail/components/ServiceDetail.tsx index 51b2eb7e..2b15520a 100644 --- a/src/modules/service-detail/components/ServiceDetail.tsx +++ b/src/modules/service-detail/components/ServiceDetail.tsx @@ -20,7 +20,10 @@ import ServiceResourceBars from "./ServiceResourceBars"; const ServiceDetail = () => { const queryClient = useQueryClient(); - const { serviceId, serviceType } = useParams(); + const { serviceId, serviceType } = useParams<{ + serviceId: string; + serviceType: Service["type"]; + }>(); const navigate = useNavigate(); const { data: response, isLoading, refetch } = useService(serviceId!); const service = response?.data || ({} as Service); diff --git a/src/modules/service/types.ts b/src/modules/service/types.ts index 38d93ef3..47720711 100644 --- a/src/modules/service/types.ts +++ b/src/modules/service/types.ts @@ -88,7 +88,7 @@ export type DownloadMessage = { export type ServiceStateProps = { serviceId: string; - serviceType: string; + serviceType: Service["type"]; refetch: () => void; isDetailView?: boolean; onOpenClick?: () => void; @@ -112,7 +112,7 @@ export type ServiceCardProps = { export type ServiceActionsProps = PropsWithChildren<{ status: ServiceStatus; serviceId: string; - serviceType: string; + serviceType: Service["type"]; refetch: () => void; isDetailView?: boolean; interfaces: App[]; diff --git a/src/shared/hooks/useStartService.ts b/src/shared/hooks/useStartService.ts index 5e55173d..e184d727 100644 --- a/src/shared/hooks/useStartService.ts +++ b/src/shared/hooks/useStartService.ts @@ -1,11 +1,13 @@ import { useMutation } from "@tanstack/react-query"; import ServiceController from "../../controller/serviceController"; +import type { Service } from "../../modules/service/types"; const useStartService = () => { const controller = new ServiceController(); - return useMutation(({ serviceId, serviceType }: { serviceId: string; serviceType: string }) => - controller.start(serviceId, serviceType), + return useMutation( + ({ serviceId, serviceType }: { serviceId: string; serviceType: Service["type"] }) => + controller.start(serviceId, serviceType), ); };