Fix refactoring issues.
This commit is contained in:
parent
fe5b68e1c4
commit
8adde69da8
|
@ -314,7 +314,7 @@ export function handleJSON<Response>(handler: () => Promise<Response>): RequestH
|
||||||
return (request, response) => {
|
return (request, response) => {
|
||||||
handler()
|
handler()
|
||||||
.then(data => success(response, data || {}))
|
.then(data => success(response, data || {}))
|
||||||
.catch(error => error(response, error));
|
.catch(e => error(response, e));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,6 +322,6 @@ export function handleJSONWithData<Response>(handler: (data: RequestData) => Pro
|
||||||
return (request, response) => {
|
return (request, response) => {
|
||||||
handler(getData(request))
|
handler(getData(request))
|
||||||
.then(data => success(response, data || {}))
|
.then(data => success(response, data || {}))
|
||||||
.catch(error => error(response, error));
|
.catch(e => error(response, e));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue