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
627 B

2 years ago
  1. import { plainToInstance } from 'class-transformer'
  2. import ApiService from '@/services/api.service'
  3. import { DownloadFormatRepository } from '@/domain/models/download/downloadFormatRepository'
  4. import { Format } from '~/domain/models/download/format'
  5. export class APIDownloadFormatRepository implements DownloadFormatRepository {
  6. constructor(private readonly request = ApiService) {}
  7. async list(projectId: string): Promise<Format[]> {
  8. const url = `/projects/${projectId}/download-format`
  9. const response = await this.request.get(url)
  10. return response.data.map((item: any) => plainToInstance(Format, item))
  11. }
  12. }