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.

15 lines
547 B

  1. import ApiService from '@/services/api.service'
  2. import { StatisticsRepository } from '@/domain/models/statistics/statisticsRepository'
  3. import { Statistics } from '~/domain/models/statistics/statistics'
  4. export class APIStatisticsRepository implements StatisticsRepository {
  5. constructor(
  6. private readonly request = ApiService
  7. ) {}
  8. async fetch(projectId: string): Promise<Statistics> {
  9. const url = `/projects/${projectId}/statistics`
  10. const response = await this.request.get(url)
  11. return Statistics.valueOf(response.data)
  12. }
  13. }