Make update_build_config use always the latest version
This commit is contained in:
parent
8c4ba096b1
commit
9802322ae9
5 changed files with 141 additions and 83 deletions
|
|
@ -4,6 +4,7 @@ import { BASE_URL_API } from "../../constants/constants";
|
|||
import { api } from "../../controllers/API/api";
|
||||
import {
|
||||
APIObjectType,
|
||||
APITemplateType,
|
||||
Component,
|
||||
LoginType,
|
||||
Users,
|
||||
|
|
@ -369,11 +370,13 @@ export async function postCustomComponent(
|
|||
|
||||
export async function postCustomComponentUpdate(
|
||||
code: string,
|
||||
template: APITemplateType,
|
||||
field: string,
|
||||
field_value: any
|
||||
): Promise<AxiosResponse<APIClassType>> {
|
||||
return await api.post(`${BASE_URL_API}custom_component/update`, {
|
||||
code,
|
||||
template,
|
||||
field,
|
||||
field_value,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,9 +9,15 @@ export const handleUpdateValues = async (name: string, data: NodeDataType) => {
|
|||
console.error("Code not found in the template");
|
||||
return;
|
||||
}
|
||||
const template = data.node?.template;
|
||||
if (!template) {
|
||||
console.error("No template found in the node.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let newTemplate = await postCustomComponentUpdate(
|
||||
code,
|
||||
template,
|
||||
name,
|
||||
data.node?.template[name]?.value
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue