mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
23 lines
607 B
TypeScript
23 lines
607 B
TypeScript
import {useApiQuery} from 'sentry/utils/queryClient';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
|
import type {ProjectSdkUpdates} from '../types/project';
|
|
|
|
interface Options {
|
|
enabled?: boolean;
|
|
projectId?: string[];
|
|
}
|
|
|
|
export function useOrganizationSDKUpdates({projectId, enabled}: Options): {
|
|
isError: boolean;
|
|
isFetching: boolean;
|
|
data?: ProjectSdkUpdates[];
|
|
} {
|
|
const organization = useOrganization();
|
|
|
|
return useApiQuery<ProjectSdkUpdates[]>(
|
|
[`/organizations/${organization.slug}/sdk-updates/`, {query: {project: projectId}}],
|
|
{staleTime: 5000, enabled}
|
|
);
|
|
}
|