diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index efb8c31..b0ccd47 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -90,8 +90,7 @@ export class DecisionApi implements Api { } return new Promise((resolve, rejected) => { - this.addEventListener(editStatusEvent.OPEN, res => { - const data = JSON.parse(res.data); + this.addEventListener(editStatusEvent.OPEN, data => { if (data.errorCode) { let errorMessage = ''; @@ -111,7 +110,7 @@ export class DecisionApi implements Api { }); rejected(data); } else { - resolve(res); + resolve(data); } }); }); diff --git a/types/globals.d.ts b/types/globals.d.ts index a00fd3b..d54e653 100644 --- a/types/globals.d.ts +++ b/types/globals.d.ts @@ -12,7 +12,7 @@ declare const Dec: { socket: { connected: boolean; emit: Function; - originOn: Function; + on: Function; hasListeners: Function; removeListener: Function; };