Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
Janaka-Steph committed Sep 22, 2023
1 parent 43e088c commit c4aa95b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/modules/service-detail/components/ServiceDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/service/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export type DownloadMessage = {

export type ServiceStateProps = {
serviceId: string;
serviceType: string;
serviceType: Service["type"];
refetch: () => void;
isDetailView?: boolean;
onOpenClick?: () => void;
Expand All @@ -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[];
Expand Down
6 changes: 4 additions & 2 deletions src/shared/hooks/useStartService.ts
Original file line number Diff line number Diff line change
@@ -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),
);
};

Expand Down

0 comments on commit c4aa95b

Please sign in to comment.