From 7744ee3639761a41f32f517536ea5d1f7df81b5a Mon Sep 17 00:00:00 2001 From: gustavoschaedler Date: Fri, 7 Jul 2023 23:12:32 +0100 Subject: [PATCH] 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. --- src/frontend/src/controllers/API/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 2d6f951f0..d2456eb40 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -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> { + return await axios.post(`/api/v1/custom_component`, { code }); +} \ No newline at end of file