Skip to content

Commit eb1f988

Browse files
committed
Switch to new instance endpoint
1 parent dc69dd3 commit eb1f988

File tree

2 files changed

+79
-7
lines changed
  • src

2 files changed

+79
-7
lines changed

src/app/pages/RoflAppInstanceDetailsPage/index.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import { FC } from 'react'
22
import { useHref, useParams } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
44
import Typography from '@mui/material/Typography'
5-
import { Layer, RoflInstance, useGetRuntimeRoflAppsIdInstances } from '../../../oasis-nexus/api'
5+
import { Layer, RoflInstance, useGetRuntimeRoflAppsIdInstancesRak } from '../../../oasis-nexus/api'
66
import { SearchScope } from '../../../types/searchScope'
77
import { AppErrors } from '../../../types/errors'
8-
import { API_MAX_TOTAL_COUNT } from '../../config'
98
import { RoflAppInstanceDetailsContext } from './hooks'
109
import { useRequiredScopeParam } from '../../hooks/useScopeParam'
1110
import { useScreenSize } from '../../hooks/useScreensize'
@@ -28,12 +27,10 @@ export const RoflAppInstanceDetailsPage: FC = () => {
2827
deleteParams: ['page'],
2928
})
3029
const context: RoflAppInstanceDetailsContext = { scope, id, rak, method, setMethod }
31-
const instancesQuery = useGetRuntimeRoflAppsIdInstances(scope.network, Layer.sapphire, id, {
32-
limit: API_MAX_TOTAL_COUNT,
33-
})
30+
const instancesQuery = useGetRuntimeRoflAppsIdInstancesRak(scope.network, Layer.sapphire, id, rak)
3431
const { isLoading, isFetched, data } = instancesQuery
35-
const instances = data?.data.instances
36-
const instance = instances?.find(inst => inst.rak === rak)
32+
const instance = data?.data
33+
3734
if (!instance && isFetched) {
3835
throw AppErrors.NotFoundRoflAppInstance
3936
}

src/oasis-nexus/generated/api.ts

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)