Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 105x 19x 105x 22x 11x | import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { API } from "aws-amplify";
import { Action, ReactQueryApiError } from "shared-types";
type PackageActionsResponse = {
actions: Action[];
};
export const getPackageActions = async (id: string): Promise<PackageActionsResponse> =>
await API.post("os", "/getPackageActions", { body: { id } });
export const useGetPackageActions = (
id: string,
options?: UseQueryOptions<PackageActionsResponse, ReactQueryApiError>,
) => {
return useQuery<PackageActionsResponse, ReactQueryApiError>(
["actions", id],
() => getPackageActions(id),
options,
);
};
|