Skip to content

Commit

Permalink
add resToRawResultFn in API GW
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Nov 29, 2024
1 parent 0dc65f5 commit bec29e9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/cubejs-api-gateway/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,17 @@ class ApiGateway {
return (message, { status }: { status?: number } = {}) => (status ? res.status(status).json(message) : res.json(message));
}

protected resToRawResultFn(res: ExpressResponse) {
return (jsonBuffer: ArrayBuffer, { status }: { status?: number } = {}) => {
if (status) {
res.status(status);
}

res.set('Content-Type', 'application/json');
res.send(jsonBuffer);
};
}

protected parseQueryParam(query): Query | Query[] {
if (!query || query === 'undefined') {
throw new UserError('Query param is required');
Expand Down

0 comments on commit bec29e9

Please sign in to comment.