You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
561 B

2 years ago
  1. import { plainToInstance } from 'class-transformer'
  2. import ApiService from '@/services/api.service'
  3. import { TaskStatusRepository } from '@/domain/models/celery/taskStatusRepository'
  4. import { Status } from '@/domain/models/celery/status'
  5. export class APITaskStatusRepository implements TaskStatusRepository {
  6. constructor(private readonly request = ApiService) {}
  7. async get(taskId: string): Promise<Status> {
  8. const url = `/tasks/status/${taskId}`
  9. const response = await this.request.get(url)
  10. return plainToInstance(Status, response.data)
  11. }
  12. }