Feat: 모델 api 추가
This commit is contained in:
parent
e7cf03593c
commit
722a15be7b
22
frontend/src/api/modelApi.ts
Normal file
22
frontend/src/api/modelApi.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import api from '@/api/axiosConfig';
|
||||
import { ModelRequest, ModelResponse, ProjectModelsResponse, ModelCategoryResponse } from '@/types';
|
||||
|
||||
export async function updateModelName(projectId: number, modelId: number, modelData: ModelRequest) {
|
||||
return api.put<ModelResponse>(`/api/projects/${projectId}/models/${modelId}`, modelData).then(({ data }) => data);
|
||||
}
|
||||
|
||||
export async function trainModel(projectId: number) {
|
||||
return api.post(`/api/projects/${projectId}/train`).then(({ data }) => data);
|
||||
}
|
||||
|
||||
export async function getProjectModels(projectId: number) {
|
||||
return api.get<ProjectModelsResponse>(`/api/projects/${projectId}/models`).then(({ data }) => data);
|
||||
}
|
||||
|
||||
export async function addProjectModel(projectId: number, modelData: ModelRequest) {
|
||||
return api.post<ModelResponse>(`/api/projects/${projectId}/models`, modelData).then(({ data }) => data);
|
||||
}
|
||||
|
||||
export async function getModelCategories(modelId: number) {
|
||||
return api.get<ModelCategoryResponse[]>(`/api/models/${modelId}/categories`).then(({ data }) => data);
|
||||
}
|
Loading…
Reference in New Issue
Block a user