13 lines
475 B
TypeScript
13 lines
475 B
TypeScript
import { InternshipType } from "@/data";
|
|
import { axios } from "@/api/index";
|
|
import { InternshipTypeDTO, internshipTypeDtoTransformer } from "@/api/dto/type";
|
|
|
|
const AVAILABLE_INTERNSHIP_TYPES = '/internshipTypes';
|
|
|
|
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));
|
|
}
|