Skip to content

Commit fa437fb

Browse files
Change supplier id header to nhsd-supplier-id
1 parent 6ae8678 commit fa437fb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

lambdas/api-handler/src/handlers/__tests__/get-letters.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('API Lambda handler', () => {
1717
const mockedGetLetterIds = letterService.getLetterIdsForSupplier as jest.Mock;
1818
mockedGetLetterIds.mockResolvedValue(['l1', 'l2', 'l3']);
1919

20-
const event = makeApiGwEvent({path: '/letters', headers: {'app-supplier-id': 'supplier1'}});
20+
const event = makeApiGwEvent({path: '/letters', headers: {'nhsd-supplier-id': 'supplier1'}});
2121
const context = mockDeep<Context>();
2222
const callback = jest.fn();
2323
const result = await getLetters(event, context, callback);
@@ -55,7 +55,7 @@ describe('API Lambda handler', () => {
5555
});
5656
});
5757

58-
it('returns 400 Bad Request: Missing supplier ID if header app-supplier-id ', async () => {
58+
it('returns 400 Bad Request: Missing supplier ID if header nhsd-supplier-id ', async () => {
5959
const event = makeApiGwEvent({path: '/letters'});
6060
const context = mockDeep<Context>();
6161
const callback = jest.fn();

lambdas/api-handler/src/handlers/__tests__/patch-letters.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('patchLetters API Handler', () => {
4848
path: '/letters/id1',
4949
body: requestBody,
5050
pathParameters: {id: "id1"},
51-
headers: {'app-supplier-id': 'supplier1'}});
51+
headers: {'nhsd-supplier-id': 'supplier1'}});
5252
const context = mockDeep<Context>();
5353
const callback = jest.fn();
5454

@@ -66,7 +66,7 @@ describe('patchLetters API Handler', () => {
6666
const event = makeApiGwEvent({
6767
path: '/letters/id1',
6868
pathParameters: {id: "id1"},
69-
headers: {'app-supplier-id': 'supplier1'}});
69+
headers: {'nhsd-supplier-id': 'supplier1'}});
7070
const context = mockDeep<Context>();
7171
const callback = jest.fn();
7272

@@ -79,7 +79,7 @@ describe('patchLetters API Handler', () => {
7979
const event = makeApiGwEvent({
8080
path: '/letters/',
8181
body: requestBody,
82-
headers: {'app-supplier-id': 'supplier1'}});
82+
headers: {'nhsd-supplier-id': 'supplier1'}});
8383
const context = mockDeep<Context>();
8484
const callback = jest.fn();
8585
const result = await patchLetters(event, context, callback);
@@ -94,7 +94,7 @@ describe('patchLetters API Handler', () => {
9494
path: '/letters/id1',
9595
body: requestBody,
9696
pathParameters: {id: "id1"},
97-
headers: {'app-supplier-id': 'supplier1'}
97+
headers: {'nhsd-supplier-id': 'supplier1'}
9898
});
9999
const context = mockDeep<Context>();
100100
const callback = jest.fn();
@@ -104,7 +104,7 @@ describe('patchLetters API Handler', () => {
104104
expect(result).toEqual(expectedErrorResponse);
105105
});
106106

107-
it('returns error when app-supplier-id is missing', async () => {
107+
it('returns error when nhsd-supplier-id is missing', async () => {
108108
const event = makeApiGwEvent({
109109
path: '/letters/id1',
110110
body: requestBody,

lambdas/api-handler/src/handlers/get-letters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const getLetters: APIGatewayProxyHandler = async (event) => {
88

99
if (event.path === '/letters') {
1010

11-
const supplierId = event.headers['app-supplier-id'];
11+
const supplierId = event.headers['nhsd-supplier-id'];
1212

1313
if (!supplierId) {
1414
return {

lambdas/api-handler/src/handlers/patch-letters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const letterRepo = createLetterRepository();
1010
export const patchLetters: APIGatewayProxyHandler = async (event) => {
1111

1212
try {
13-
const supplierId = assertNotEmpty(event.headers['app-supplier-id'], errors.ApiErrorDetail.InvalidRequestMissingSupplierId);
13+
const supplierId = assertNotEmpty(event.headers['nhsd-supplier-id'], errors.ApiErrorDetail.InvalidRequestMissingSupplierId);
1414
const letterId = assertNotEmpty( event.pathParameters?.id, errors.ApiErrorDetail.InvalidRequestMissingLetterIdPathParameter);
1515
const body = assertNotEmpty(event.body, errors.ApiErrorDetail.InvalidRequestMissingBody);
1616

0 commit comments

Comments
 (0)