diff --git a/src/components/content/deployedServices/myServices/MyServices.tsx b/src/components/content/deployedServices/myServices/MyServices.tsx index f936ec291..012dc3ecb 100644 --- a/src/components/content/deployedServices/myServices/MyServices.tsx +++ b/src/components/content/deployedServices/myServices/MyServices.tsx @@ -130,7 +130,7 @@ function MyServices(): React.JSX.Element { const [clearFormVariables] = useOrderFormStore((state) => [state.clearFormVariables]); const navigate = useNavigate(); const listDeployedServicesQuery = useListDeployedServicesDetailsQuery(); - const getOrderableServiceDetails = useGetOrderableServiceDetailsQuery(activeRecord?.serviceTemplateId); + const getOrderableServiceDetails = useGetOrderableServiceDetailsQuery(activeRecord?.serviceId); const getDestroyServiceStatusPollingQuery = useLatestServiceOrderStatusQuery( serviceDestroyQuery.data?.orderId ?? '', diff --git a/src/components/content/deployedServices/myServices/query/useGetOrderableServiceDetailsQuery.ts b/src/components/content/deployedServices/myServices/query/useGetOrderableServiceDetailsQuery.ts index 9a5761321..76fb6334b 100644 --- a/src/components/content/deployedServices/myServices/query/useGetOrderableServiceDetailsQuery.ts +++ b/src/components/content/deployedServices/myServices/query/useGetOrderableServiceDetailsQuery.ts @@ -5,20 +5,20 @@ import { useQuery } from '@tanstack/react-query'; import { - getOrderableServiceDetailsById, - type GetOrderableServiceDetailsByIdData, + getOrderableServiceDetailsByServiceId, + GetOrderableServiceDetailsByServiceIdData, } from '../../../../../xpanse-api/generated'; -export default function useGetOrderableServiceDetailsQuery(serviceTemplateId: string | undefined) { +export default function useGetOrderableServiceDetailsQuery(serviceId: string | undefined) { return useQuery({ - queryKey: ['getOrderableServiceDetailsById', serviceTemplateId], + queryKey: ['getOrderableServiceDetailsByServiceId', serviceId], queryFn: () => { - const data: GetOrderableServiceDetailsByIdData = { - id: serviceTemplateId ?? '', + const data: GetOrderableServiceDetailsByServiceIdData = { + serviceId: serviceId ?? '', }; - return getOrderableServiceDetailsById(data); + return getOrderableServiceDetailsByServiceId(data); }, refetchOnWindowFocus: false, - enabled: serviceTemplateId !== undefined && serviceTemplateId.length > 0, + enabled: serviceId !== undefined && serviceId.length > 0, }); }