UNPKG

@roadiehq/backstage-plugin-github-pull-requests

Version:
17 lines (14 loc) 586 B
import { useApi } from '@backstage/core-plugin-api'; import { useAsync } from 'react-use'; import { githubPullRequestsApiRef } from '../api/GithubPullRequestsApi.esm.js'; import '@backstage/integration'; import '@octokit/rest'; import 'luxon'; const useGithubSearchPullRequest = (query, hostname) => { const githubPrsApi = useApi(githubPullRequestsApiRef); return useAsync(async () => { return await githubPrsApi.searchPullRequest({ query, hostname }); }, [githubPrsApi]); }; export { useGithubSearchPullRequest }; //# sourceMappingURL=useGithubSearchPullRequest.esm.js.map