Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected] - Update GET Consumer Details route #2572

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/components/pages/f-account-info/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## v1.9.0

_November 27, 2024_

### Changed

- Send `Accept-Tenant` header for `ConsumerAPI` requests

## v1.8.1

_April 29, 2024_
Expand Down
2 changes: 1 addition & 1 deletion packages/components/pages/f-account-info/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@justeat/f-account-info",
"description": "Fozzie Account Info - The account information page",
"version": "1.8.1",
"version": "1.9.0",
"main": "dist/f-account-info.umd.min.js",
"maxBundleSize": "55kB",
"files": [
Expand Down
1 change: 1 addition & 0 deletions packages/components/pages/f-account-info/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export const CONSUMER_DETAILS_URL = 'consumer';
export const CONSUMER_ADDRESSES_URL = 'consumer/addresses';

export const AUTHORISATION_HEADER_NAME = 'Authorization';
export const ACCEPT_TENANT_HEADER_NAME = 'Accept-Tenant';
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {
CONSUMER_DETAILS_URL,
CONSUMER_ADDRESSES_URL,
AUTHORISATION_HEADER_NAME
AUTHORISATION_HEADER_NAME,
ACCEPT_TENANT_HEADER_NAME
} from '../../constants';

const BuildHeaders = authToken => {
const headers = {
[AUTHORISATION_HEADER_NAME]: authToken ? `Bearer ${authToken}` : ''
[AUTHORISATION_HEADER_NAME]: authToken ? `Bearer ${authToken}` : '',
[ACCEPT_TENANT_HEADER_NAME]: 'uk'
};

return headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import ConsumerApi from '../Consumer.api';
import {
CONSUMER_DETAILS_URL,
CONSUMER_ADDRESSES_URL,
AUTHORISATION_HEADER_NAME
AUTHORISATION_HEADER_NAME,
ACCEPT_TENANT_HEADER_NAME
} from '../../../constants';
import {
baseUrl,
Expand Down Expand Up @@ -54,7 +55,8 @@ describe('ConsumerApi Provider', () => {
// Arrange
const expectedUri = `${baseUrl}/${CONSUMER_DETAILS_URL}`;
const expectedHeaders = {
[AUTHORISATION_HEADER_NAME]: `Bearer ${token}`
[AUTHORISATION_HEADER_NAME]: `Bearer ${token}`,
[ACCEPT_TENANT_HEADER_NAME]: 'uk'
};

// Act
Expand All @@ -70,7 +72,8 @@ describe('ConsumerApi Provider', () => {
// Arrange
const expectedUri = `${baseUrl}/${CONSUMER_ADDRESSES_URL}`;
const expectedHeaders = {
[AUTHORISATION_HEADER_NAME]: `Bearer ${token}`
[AUTHORISATION_HEADER_NAME]: `Bearer ${token}`,
[ACCEPT_TENANT_HEADER_NAME]: 'uk'
};

// Act
Expand All @@ -87,7 +90,8 @@ describe('ConsumerApi Provider', () => {
const expectedUri = `${baseUrl}/${CONSUMER_DETAILS_URL}`;
const expectedBody = consumerUpdateBody;
const expectedHeaders = {
[AUTHORISATION_HEADER_NAME]: `Bearer ${token}`
[AUTHORISATION_HEADER_NAME]: `Bearer ${token}`,
[ACCEPT_TENANT_HEADER_NAME]: 'uk'
};

// Act
Expand Down
Loading