2021-06-09 13:03:58 +02:00
|
|
|
import apiClient from './clients/api-client';
|
|
|
|
import { AxiosResponse } from 'axios';
|
2021-06-10 14:06:53 +02:00
|
|
|
import { Plan, PlansDuration } from '../models/plan';
|
2021-06-09 13:03:58 +02:00
|
|
|
|
|
|
|
export default class PlanAPI {
|
|
|
|
static async index (): Promise<Array<Plan>> {
|
|
|
|
const res: AxiosResponse<Array<Plan>> = await apiClient.get('/api/plans');
|
|
|
|
return res?.data;
|
|
|
|
}
|
2021-06-10 14:06:53 +02:00
|
|
|
|
|
|
|
static async durations (): Promise<Array<PlansDuration>> {
|
2021-07-01 12:04:48 +02:00
|
|
|
const res: AxiosResponse<Array<PlansDuration>> = await apiClient.get('/api/plans/durations');
|
2021-06-10 14:06:53 +02:00
|
|
|
return res?.data;
|
|
|
|
}
|
2021-06-09 13:03:58 +02:00
|
|
|
}
|