Fix refactoring issues.

This commit is contained in:
baldo 2022-08-02 15:24:53 +02:00
parent fe5b68e1c4
commit 8adde69da8

View file

@ -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));
}; };
} }