mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-18 20:39:46 +00:00
feature(backups): get all snapshots if requested by api
This commit is contained in:
parent
2168037a10
commit
d6609b29e8
1 changed files with 8 additions and 1 deletions
|
@ -37,4 +37,11 @@ class Backup:
|
||||||
|
|
||||||
@strawberry.field
|
@strawberry.field
|
||||||
def all_snapshots(self) -> typing.List[SnapshotInfo]:
|
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue