Skip to content
This repository was archived by the owner on Jan 3, 2020. It is now read-only.

Commit b45b653

Browse files
authored
Fix return on reject
1 parent 1f29938 commit b45b653

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/Data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const fetchByXPath = (options: Data.FetchByXPathOptions): Promise<MxObject[]> =>
3838

3939
const fetchByMicroflow = (actionName: string, contextObj: MxObject, mxform: mxui.lib.form._FormBase, inputParameterEntity: string): Promise<MxObject[]> => {
4040
if (contextObj.getEntity() !== inputParameterEntity) {
41-
Promise.reject(new Error("Input parameter entity does not match the context object type"));
41+
return Promise.reject(new Error("Input parameter entity does not match the context object type"));
4242
}
4343

4444
return new Promise((resolve, reject) => {
@@ -55,7 +55,7 @@ const fetchByMicroflow = (actionName: string, contextObj: MxObject, mxform: mxui
5555

5656
const fetchByNanoflow = (nanoflow: Data.Nanoflow, contextObj: MxObject, mxform: mxui.lib.form._FormBase, inputParameterEntity: string): Promise<MxObject[]> => {
5757
if (contextObj.getEntity() !== inputParameterEntity) {
58-
Promise.reject(new Error("Input parameter entity does not match the context object type"));
58+
return Promise.reject(new Error("Input parameter entity does not match the context object type"));
5959
}
6060

6161
return new Promise((resolve: (objects: MxObject[]) => void, reject) => {

0 commit comments

Comments
 (0)