Advertisement
Guest User

Untitled

a guest
Sep 4th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       gantt.createDataProcessor({
  2.             link: {
  3.                 create: (data: Link) => this.api.linkCreate(data)
  4.                     .then(result => {
  5.                         console.log('created link: ', result);
  6.                         gantt.changeLinkId(data.id as string, result.id as string);
  7.                     })
  8.                     .catch(error => {
  9.                         gantt.undo();
  10.                         this.displayError(error);
  11.                     }),
  12.                 delete: (id: string) => this.api.linkRemove(id)
  13.                     .then(_result => void 0)
  14.                     .catch(error => {
  15.                         gantt.undo();
  16.                         this.displayError(error);
  17.                     }),
  18.                 update: (data: Link) => this.api.linkUpdate(data)
  19.                     .then(result => {
  20.                         gantt.changeLinkId(data.id as string, result.id as string);
  21.                     })
  22.                     .catch(error => {
  23.                         gantt.undo();
  24.                         this.displayError(error);
  25.                     }),
  26.             },
  27.             task: {
  28.                 create: (data: Task) => this.api.taskCreate(data)
  29.                     .then(result => {
  30.                         console.log('created task: ', result);
  31.                         gantt.changeTaskId(data.id as string, result.id as string);
  32.                     })
  33.                     .catch(error => {
  34.                         gantt.undo();
  35.                         this.displayError(error);
  36.                     }),
  37.                 delete: (id: string) => this.api.taskRemove(id)
  38.                     .then(_result => void 0)
  39.                     .catch(error => {
  40.                         gantt.undo();
  41.                         this.displayError(error);
  42.                     }),
  43.                 update: (data: Task) => this.api.taskUpdate(data)
  44.                     .then(_result => void 0)
  45.                     .catch(error => {
  46.                         gantt.undo();
  47.                         this.displayError(error);
  48.                     }),
  49.             },
  50.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement