Hi everyone,
I'm using the Gantt component library and running into an issue with temporary task IDs. When a task is created on the frontend, it is assigned a temporary ID (e.g., "temp://1740162243539"). Simultaneously, I create the task on the backend, which returns the definitive database ID after saving.
The problem arises when subsequent operations (like creating a child task) reference the parent's temporary ID. This causes issues because the child task ends up with a parent value that doesn't match the actual database ID.
Example of a task object:
{
id: "temp://1740162243539",
inProgress: false,
task: {
$h: 31,
$level: 1,
$skip: false,
$w: 100,
$x: 200,
$y: 269,
details: "",
duration: 1,
end: "2025-02-22T23:00:00.000Z",
id: "temp://1740162243539",
parent: 0,
progress: 0,
start: "2025-02-21T23:00:00.000Z",
text: "task",
type: "task"
}
}
My question is:
Is there a built-in method or recommended approach in the Gantt API to update a task’s ID from a temporary one to the definitive database ID after the backend returns it? If not, what is the best strategy to handle such updates (ensuring that references like parent in child tasks are correctly updated) within the Gantt component?
In the backend i'm following the Guide POST /tasks and the Guide of .send()
Also I tried to call the api.exec("provide-data", { ... }) to update the task id, but no success.
Any guidance or suggestions would be greatly appreciated!
Thank you!