feat: remove individual snapshot (#26)

This commit is contained in:
Nico
2025-11-16 11:14:18 +01:00
committed by GitHub
parent c0bef7f65e
commit e5435969be
11 changed files with 452 additions and 108 deletions

View File

@@ -327,6 +327,18 @@ const doctorRepository = async (name: string) => {
};
};
const deleteSnapshot = async (name: string, snapshotId: string) => {
const repository = await db.query.repositoriesTable.findFirst({
where: eq(repositoriesTable.name, name),
});
if (!repository) {
throw new NotFoundError("Repository not found");
}
await restic.deleteSnapshot(repository.config, snapshotId);
};
export const repositoriesService = {
listRepositories,
createRepository,
@@ -338,4 +350,5 @@ export const repositoriesService = {
getSnapshotDetails,
checkHealth,
doctorRepository,
deleteSnapshot,
};