Add postCustomComponent API controller for uploading custom components.

This commit adds the postCustomComponent function to the API controller. It allows for uploading custom components by sending a POST request to `/api/v1/custom_component` with the code as a parameter.
This commit is contained in:
gustavoschaedler 2023-07-07 23:12:32 +01:00
commit 7744ee3639

View file

@ -339,3 +339,10 @@ export async function uploadFile(
formData.append("file", file);
return await axios.post(`/api/v1/upload/${id}`, formData);
}
export async function postCustomComponent(
code: string,
apiClass: APIClassType
): Promise<AxiosResponse<APIClassType>> {
return await axios.post(`/api/v1/custom_component`, { code });
}