import { EXERCICES } from "@/api/endpoints";
import { Workout } from "@/model/Workout";
import { AbstractService } from "../abstract.service";
import { IExerciceService } from "./exercice.service.interface";

export class ExerciceAPIService
  extends AbstractService
  implements IExerciceService
{
  async getExercices(): Promise<Workout[]> {
    const data = await this.request(EXERCICES.GETALL);
    return data.data.map((item: any) => Workout.fromJson(item));
  }
}
