Merge remote-tracking branch 'origin/python_custom_node_component' into form_io
This commit is contained in:
commit
bc4edde8d7
3 changed files with 53 additions and 8 deletions
|
|
@ -336,9 +336,10 @@ export async function uploadFile(
|
|||
formData.append("file", file);
|
||||
return await axios.post(`/api/v1/upload/${id}`, formData);
|
||||
}
|
||||
export async function UpdateTemplate(
|
||||
type: string,
|
||||
nodeClass: APIClassType
|
||||
|
||||
export async function postCustomComponent(
|
||||
code: string,
|
||||
apiClass: APIClassType
|
||||
): Promise<AxiosResponse<APIClassType>> {
|
||||
return await axios.get(`/dynamic_node`);
|
||||
return await axios.post(`/api/v1/custom_component`, { code });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import "ace-builds/src-noconflict/theme-twilight";
|
|||
import "ace-builds/src-noconflict/ext-language_tools";
|
||||
// import "ace-builds/webpack-resolver";
|
||||
import { darkContext } from "../../contexts/darkContext";
|
||||
import { UpdateTemplate, postValidateCode } from "../../controllers/API";
|
||||
import { postCustomComponent, postValidateCode } from "../../controllers/API";
|
||||
import { alertContext } from "../../contexts/alertContext";
|
||||
import {
|
||||
Dialog,
|
||||
|
|
@ -89,10 +89,9 @@ export default function CodeAreaModal({
|
|||
title: "There is something wrong with this code, please review it",
|
||||
});
|
||||
});
|
||||
UpdateTemplate("code", nodeClass).then((apiReturn) => {
|
||||
postCustomComponent(code, nodeClass).then((apiReturn) => {
|
||||
const data = apiReturn.data;
|
||||
if (data) {
|
||||
console.log(data);
|
||||
setNodeClass(data);
|
||||
setModalOpen(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue