1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
vault-frontend/src/api/lab/index.ts
2023-11-17 23:24:33 +06:00

25 lines
607 B
TypeScript

import { API } from '~/constants/api';
import {
GetLabNodesRequest,
GetLabNodesResult,
GetLabStatsResult,
GetLabUpdatesResult,
} from '~/types/lab';
import { api, unwrap } from '~/utils/api';
export const getLabNodes = ({
offset,
limit,
sort,
search,
}: GetLabNodesRequest) =>
api
.get<GetLabNodesResult>(API.LAB.NODES, {
params: { offset, limit, sort, search },
})
.then(unwrap);
export const getLabStats = () =>
api.get<GetLabStatsResult>(API.LAB.STATS).then(unwrap);
export const getLabUpdates = () =>
api.get<GetLabUpdatesResult>(API.LAB.UPDATES).then(unwrap);