Skip to content

Commit c2bc8c7

Browse files
authored
feat: add response to requestContextProvider (#304)
#292
1 parent aa42793 commit c2bc8c7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/config/config.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class ConfigController {
6262
@Headers('Accept-language') acceptLanguage: string,
6363
): Promise<PortalConfig> {
6464
const token = this.headerParser.extractBearerToken(request);
65-
const context = await this.requestContextProvider.getContextValues(request);
65+
const context = await this.requestContextProvider.getContextValues(request, response);
6666

6767
const providersPromise = this.luigiConfigNodesService
6868
.getNodes(token, [], acceptLanguage, context)
@@ -110,6 +110,7 @@ export class ConfigController {
110110
const token = this.headerParser.extractBearerToken(request);
111111
const context = await this.requestContextProvider.getContextValues(
112112
request,
113+
response,
113114
params.entity,
114115
);
115116

src/config/context/request-context-provider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Request } from 'express';
44
export interface RequestContextProvider {
55
getContextValues(
66
request: Request,
7+
response: Response,
78
entity?: string,
89
): Promise<Record<string, any>>;
910
}
@@ -13,4 +14,4 @@ export class RequestContextProviderImpl implements RequestContextProvider {
1314
async getContextValues(request: Request): Promise<Record<string, any>> {
1415
return request.query;
1516
}
16-
}
17+
}

0 commit comments

Comments
 (0)