mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
19 lines
453 B
TypeScript
19 lines
453 B
TypeScript
import type {Organization} from 'sentry/types';
|
|
import useProjects from 'sentry/utils/useProjects';
|
|
|
|
function useProjectFromSlug({
|
|
organization,
|
|
projectSlug,
|
|
}: {
|
|
organization: Organization;
|
|
projectSlug: undefined | string;
|
|
}) {
|
|
const {fetching, projects} = useProjects({
|
|
slugs: projectSlug ? [projectSlug] : undefined,
|
|
orgId: organization.slug,
|
|
});
|
|
return fetching ? undefined : projects[0];
|
|
}
|
|
|
|
export default useProjectFromSlug;
|