ui(api): add useDirtyState + apply=staged|live on useUpdateApplicationConfig
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -203,3 +203,27 @@ export function usePromoteDeployment() {
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ['apps'] }),
|
||||
});
|
||||
}
|
||||
|
||||
// --- Dirty State ---
|
||||
|
||||
export interface DirtyStateDifference {
|
||||
field: string;
|
||||
staged: string;
|
||||
deployed: string;
|
||||
}
|
||||
|
||||
export interface DirtyState {
|
||||
dirty: boolean;
|
||||
lastSuccessfulDeploymentId: string | null;
|
||||
differences: DirtyStateDifference[];
|
||||
}
|
||||
|
||||
export function useDirtyState(envSlug: string | undefined, appSlug: string | undefined) {
|
||||
return useQuery({
|
||||
queryKey: ['apps', envSlug, appSlug, 'dirty-state'],
|
||||
queryFn: () => apiFetch<DirtyState>(
|
||||
`${envBase(envSlug!)}/${encodeURIComponent(appSlug!)}/dirty-state`,
|
||||
),
|
||||
enabled: !!envSlug && !!appSlug,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user