Saving Changes without DataProcessor

Hi, i am using a custom backend and api endpoints. How i can implement error callbacks in hooks?

gantt.attachEvent('onBeforeLinkAdd', (id, link) => {
    myCrudService.updateLink(link).then((response) => {}, (error) => {
         // How i can remove link if business logic fails?
         // gantt.deleteLink triggered onAfterLinkDelete (no need this)
   });
});

Hello,
I think gantt.deleteLink is an expected way here - you delete link on the client-side after it was rejected on the server.
It would also invoke onAfterLinkDelete and you probably have onAfterLinkDelete event handlers that would send delete requests to the backend when you cancel link. If that’s the case - you can set come flag and not call the api service for this action, e.g.

[code]gantt.attachEvent(‘onAfterLinkAdd’, (id, link) => {
myCrudService.updateLink(link).then((response) => {}, (error) => {
gantt.getLink(id).doNotSend = true;
gantt.deleteLink(id);
});
});

gantt.attachEvent(‘onAfterLinkDelete’, (id, link) => {
if(link.doNotSend) return;

myCrudService.deleteLink(id).then((response) => {}, (error) => {});

});[/code]