Skip to content

Commit

Permalink
Add default parameter to metadata requests to fix Hawk issue. (#6758)
Browse files Browse the repository at this point in the history
* Add default parameter to end point for metadata requests to fix Hawk issue.
  • Loading branch information
marijnkampf authored and cgsunkel committed May 17, 2024
1 parent 357aad3 commit bfec888
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/client/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const transformMetadataOption = ({ id, name }) => ({
*/
async function getMetadataOptions(
url,
{ filterDisabled = true, params = {} } = {}
{ filterDisabled = true, params = { _: 0 } } = {}
) {
const { data } = await axios.get(url, {
params,
Expand Down
2 changes: 1 addition & 1 deletion test/functional/cypress/specs/companies/filter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const activeStatusFlag = 'false'
const inactiveStatusFlag = 'true'
const companySearchEndpoint = '/api-proxy/v4/search/company'
const adviserSearchEndpoint = '/api-proxy/v4/search/adviser'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region*'
const usaCountryId = '81756b9a-5d95-e211-a939-e4115bead28a'
const canadaCountryId = '5daf72a6-5d95-e211-a939-e4115bead28a'
const usStatesEndpoint = `/api-proxy/v4/metadata/administrative-area?country=${usaCountryId}`
Expand Down
2 changes: 1 addition & 1 deletion test/functional/cypress/specs/contacts/filter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { contactsListFaker } from '../../fakers/contacts'
import { ukRegionListFaker } from '../../fakers/regions'

const searchEndpoint = '/api-proxy/v3/search/contact'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region*'

const buildQueryString = (queryParams = {}) =>
qs.stringify({
Expand Down
4 changes: 2 additions & 2 deletions test/functional/cypress/specs/events/filter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
import { ukRegionListFaker } from '../../fakers/regions'

const searchEndpoint = '/api-proxy/v3/search/event'
const eventTypeEndpoint = '/api-proxy/v4/metadata/event-type'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region'
const eventTypeEndpoint = '/api-proxy/v4/metadata/event-type*'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region*'

const disabledEventType = eventTypeFaker({ disabled_on: '2020-01-01' })
const eventTypes = [disabledEventType, ...eventTypeListFaker(2)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ describe('Export filters', () => {
),
},
}).as('apiRequestCountry')
cy.intercept('GET', urls.metadata.country(), countries).as(
cy.intercept('GET', `${urls.metadata.country()}?_=0`, countries).as(
'apiRequestMetadataCountry'
)
})
Expand Down
12 changes: 6 additions & 6 deletions test/functional/cypress/specs/interaction/filter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ const minimumPayload = {
sortby: 'date:desc',
}

const interactionsSearchEndpoint = '/api-proxy/v3/search/interaction'
const interactionsSearchEndpoint = '/api-proxy/v3/search/interaction*'
const adviserAutocompleteEndpoint = '/api-proxy/adviser/?autocomplete=*'
const adviserSearchEndpoint = '/api-proxy/v4/search/adviser'
const adviserSearchEndpoint = '/api-proxy/v4/search/adviser*'
const companyAutocompleteEndpoint = '/api-proxy/v4/company?autocomplete=*'
const serviceMetadataEndpoint = '/api-proxy/v4/metadata/service'
const policyAreaMetadataEndpoint = '/api-proxy/v4/metadata/policy-area'
const serviceMetadataEndpoint = '/api-proxy/v4/metadata/service*'
const policyAreaMetadataEndpoint = '/api-proxy/v4/metadata/policy-area*'
const policyIssueTypeMetadataEndpoint =
'/api-proxy/v4/metadata/policy-issue-type'
'/api-proxy/v4/metadata/policy-issue-type*'
const companyOneListTierGroupMetadataEndpoint =
'/api-proxy/v4/metadata/one-list-tier'
'/api-proxy/v4/metadata/one-list-tier*'

const myAdviserId = '7d19d407-9aec-4d06-b190-d3f404627f21'

Expand Down
2 changes: 1 addition & 1 deletion test/functional/cypress/specs/investments/filter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const myAdviser = {
const searchEndpoint = '/api-proxy/v3/search/investment_project'
const adviserSearchEndpoint = '/api-proxy/v4/search/adviser'
const adviserAutocompleteEndpoint = '/api-proxy/adviser/?autocomplete=*'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region*'

describe('Investments Collections Filter', () => {
context('Toggle groups', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/cypress/specs/omis/filter-react-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const statuses = [
]

const searchEndpoint = '/api-proxy/v3/search/order'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region'
const ukRegionsEndpoint = '/api-proxy/v4/metadata/uk-region*'

describe('Orders Collections Filter', () => {
context('Default Params', () => {
Expand Down

0 comments on commit bfec888

Please sign in to comment.