mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat(snapshots): list files in snapshots api
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
deleteRepository,
|
||||
getRepository,
|
||||
listSnapshots,
|
||||
listSnapshotFiles,
|
||||
listBackupSchedules,
|
||||
createBackupSchedule,
|
||||
deleteBackupSchedule,
|
||||
@@ -67,6 +68,7 @@ import type {
|
||||
DeleteRepositoryResponse,
|
||||
GetRepositoryData,
|
||||
ListSnapshotsData,
|
||||
ListSnapshotFilesData,
|
||||
ListBackupSchedulesData,
|
||||
CreateBackupScheduleData,
|
||||
CreateBackupScheduleResponse,
|
||||
@@ -715,6 +717,27 @@ export const listSnapshotsOptions = (options: Options<ListSnapshotsData>) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const listSnapshotFilesQueryKey = (options: Options<ListSnapshotFilesData>) =>
|
||||
createQueryKey("listSnapshotFiles", options);
|
||||
|
||||
/**
|
||||
* List files and directories in a snapshot
|
||||
*/
|
||||
export const listSnapshotFilesOptions = (options: Options<ListSnapshotFilesData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listSnapshotFiles({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listSnapshotFilesQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const listBackupSchedulesQueryKey = (options?: Options<ListBackupSchedulesData>) =>
|
||||
createQueryKey("listBackupSchedules", options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user