mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-09 20:53:10 +00:00
refactoring(jobs): break out a function returning all jobs
This commit is contained in:
parent
5bf5e7462f
commit
8d099c9a22
|
@ -11,13 +11,17 @@ from selfprivacy_api.graphql.common_types.jobs import (
|
|||
from selfprivacy_api.jobs import Jobs
|
||||
|
||||
|
||||
def get_all_jobs() -> typing.List[ApiJob]:
|
||||
Jobs.get_jobs()
|
||||
|
||||
return [job_to_api_job(job) for job in Jobs.get_jobs()]
|
||||
|
||||
|
||||
@strawberry.type
|
||||
class Job:
|
||||
@strawberry.field
|
||||
def get_jobs(self) -> typing.List[ApiJob]:
|
||||
Jobs.get_jobs()
|
||||
|
||||
return [job_to_api_job(job) for job in Jobs.get_jobs()]
|
||||
return get_all_jobs()
|
||||
|
||||
@strawberry.field
|
||||
def get_job(self, job_id: str) -> typing.Optional[ApiJob]:
|
||||
|
|
Loading…
Reference in a new issue