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.

16 lines
569 B

  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(
  7. private readonly request = ApiService
  8. ) {}
  9. async get(taskId: string): Promise<Status> {
  10. const url = `/tasks/status/${taskId}`
  11. const response = await this.request.get(url)
  12. return plainToInstance(Status, response.data)
  13. }
  14. }