From 0b8f77e6f75c20804057648f77c51f0e7a3edbd1 Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Mon, 5 Jun 2023 11:49:37 +0000 Subject: [PATCH] feature(backups): set autobackup period from gql --- selfprivacy_api/graphql/mutations/backup_mutations.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/selfprivacy_api/graphql/mutations/backup_mutations.py b/selfprivacy_api/graphql/mutations/backup_mutations.py index c5c63bf..a227106 100644 --- a/selfprivacy_api/graphql/mutations/backup_mutations.py +++ b/selfprivacy_api/graphql/mutations/backup_mutations.py @@ -65,6 +65,14 @@ class BackupMutations: Backups.reset() return Backup.configuration() + @strawberry.mutation(permission_classes=[IsAuthenticated]) + def set_autobackup_period( + self, period: typing.Optional[int] = None + ) -> GenericBackupConfigReturn: + """Set autobackup period. None is to disable autobackup""" + Backups.set_autobackup_period_minutes(period) + return Backup.configuration() + @strawberry.mutation(permission_classes=[IsAuthenticated]) def start_backup( self, service_id: typing.Optional[str] = None