Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gantt.createDataProcessor({
- link: {
- create: (data: Link) => this.api.linkCreate(data)
- .then(result => {
- console.log('created link: ', result);
- gantt.changeLinkId(data.id as string, result.id as string);
- })
- .catch(error => {
- gantt.undo();
- this.displayError(error);
- }),
- delete: (id: string) => this.api.linkRemove(id)
- .then(_result => void 0)
- .catch(error => {
- gantt.undo();
- this.displayError(error);
- }),
- update: (data: Link) => this.api.linkUpdate(data)
- .then(result => {
- gantt.changeLinkId(data.id as string, result.id as string);
- })
- .catch(error => {
- gantt.undo();
- this.displayError(error);
- }),
- },
- task: {
- create: (data: Task) => this.api.taskCreate(data)
- .then(result => {
- console.log('created task: ', result);
- gantt.changeTaskId(data.id as string, result.id as string);
- })
- .catch(error => {
- gantt.undo();
- this.displayError(error);
- }),
- delete: (id: string) => this.api.taskRemove(id)
- .then(_result => void 0)
- .catch(error => {
- gantt.undo();
- this.displayError(error);
- }),
- update: (data: Task) => this.api.taskUpdate(data)
- .then(_result => void 0)
- .catch(error => {
- gantt.undo();
- this.displayError(error);
- }),
- },
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement