mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 04:14:38 +00:00
Improved polling
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
DeleteWorkspaceDTO,
|
||||
NameWorkspaceSecretsDTO,
|
||||
RenameWorkspaceDTO,
|
||||
TGetUpgradeProjectStatusDTO,
|
||||
ToggleAutoCapitalizationDTO,
|
||||
UpdateEnvironmentDTO,
|
||||
Workspace
|
||||
@@ -85,11 +86,18 @@ export const useUpgradeProject = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetUpgradeProjectStatus = (projectId: string) => {
|
||||
export const useGetUpgradeProjectStatus = ({
|
||||
projectId,
|
||||
onSuccess,
|
||||
enabled,
|
||||
refetchInterval
|
||||
}: TGetUpgradeProjectStatusDTO) => {
|
||||
return useQuery({
|
||||
queryKey: workspaceKeys.getProjectUpgradeStatus(projectId),
|
||||
queryFn: () => fetchProjectUpgradeStatus(projectId),
|
||||
enabled: true
|
||||
enabled,
|
||||
onSuccess,
|
||||
refetchInterval
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -31,6 +31,13 @@ export type NameWorkspaceSecretsDTO = {
|
||||
}[];
|
||||
};
|
||||
|
||||
export type TGetUpgradeProjectStatusDTO = {
|
||||
projectId: string;
|
||||
onSuccess?: (data?: { status: string }) => void;
|
||||
enabled?: boolean;
|
||||
refetchInterval?: number;
|
||||
};
|
||||
|
||||
// mutation dto
|
||||
export type CreateWorkspaceDTO = {
|
||||
projectName: string;
|
||||
|
||||
Reference in New Issue
Block a user