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

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