mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
refactor(backups): tag snapshots by backup id and run forget by grouping first by tags
This commit is contained in:
@@ -32,7 +32,6 @@ import {
|
||||
getBackupSchedule,
|
||||
updateBackupSchedule,
|
||||
getBackupScheduleForVolume,
|
||||
upsertBackupSchedule,
|
||||
runBackupNow,
|
||||
} from "../sdk.gen";
|
||||
import { queryOptions, type UseMutationOptions, type DefaultError } from "@tanstack/react-query";
|
||||
@@ -83,8 +82,6 @@ import type {
|
||||
UpdateBackupScheduleData,
|
||||
UpdateBackupScheduleResponse,
|
||||
GetBackupScheduleForVolumeData,
|
||||
UpsertBackupScheduleData,
|
||||
UpsertBackupScheduleResponse,
|
||||
RunBackupNowData,
|
||||
RunBackupNowResponse,
|
||||
} from "../types.gen";
|
||||
@@ -957,29 +954,6 @@ export const getBackupScheduleForVolumeOptions = (options: Options<GetBackupSche
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create or update a backup schedule for a volume
|
||||
*/
|
||||
export const upsertBackupScheduleMutation = (
|
||||
options?: Partial<Options<UpsertBackupScheduleData>>,
|
||||
): UseMutationOptions<UpsertBackupScheduleResponse, DefaultError, Options<UpsertBackupScheduleData>> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
UpsertBackupScheduleResponse,
|
||||
DefaultError,
|
||||
Options<UpsertBackupScheduleData>
|
||||
> = {
|
||||
mutationFn: async (localOptions) => {
|
||||
const { data } = await upsertBackupSchedule({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const runBackupNowQueryKey = (options: Options<RunBackupNowData>) => createQueryKey("runBackupNow", options);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user