feature(backups): get all snapshots if requested by api

restic-rewrite-api
Houkime 2023-06-05 11:36:58 +00:00
parent 2168037a10
commit d6609b29e8
1 changed files with 8 additions and 1 deletions

View File

@ -37,4 +37,11 @@ class Backup:
@strawberry.field
def all_snapshots(self) -> typing.List[SnapshotInfo]:
return []
result = []
snapshots = Backups.get_all_snapshots()
for snap in snapshots:
graphql_snap = SnapshotInfo(
id=snap.id, service=snap.service_name, created_at=snap.created_at
)
result.append(graphql_snap)
return result