system-praktyk-front/src/api/type.ts
2020-11-18 19:29:58 +01:00

13 lines
483 B
TypeScript

import { InternshipType } from "@/data";
import { axios } from "@/api/index";
import { InternshipTypeDTO, internshipTypeDtoTransformer } from "@/api/dto/type";
const AVAILABLE_INTERNSHIP_TYPES = '/internshipTypes/current';
export async function available(): Promise<InternshipType[]> {
const response = await axios.get<InternshipTypeDTO[]>(AVAILABLE_INTERNSHIP_TYPES);
const dtos = response.data;
return dtos.map(dto => internshipTypeDtoTransformer.transform(dto));
}