diff --git a/app/assets/javascripts/jobs/store/actions.js b/app/assets/javascripts/jobs/store/actions.js index 298367c934244f3a089780a3db190f04c12d010d..c8e1090bcc569ff212b25c81fc72bdd0bba71c92 100644 --- a/app/assets/javascripts/jobs/store/actions.js +++ b/app/assets/javascripts/jobs/store/actions.js @@ -139,7 +139,7 @@ export const fetchStages = ({ state, dispatch }) => { dispatch('requestStages'); axios - .get(state.job.pipeline.path) + .get(`${state.job.pipeline.path}.json`) .then(({ data }) => { dispatch('receiveStagesSuccess', data.details.stages); dispatch('fetchJobsForStage', data.details.stages[0]); diff --git a/changelogs/unreleased/52472-pipeline-endpoint-json.yml b/changelogs/unreleased/52472-pipeline-endpoint-json.yml new file mode 100644 index 0000000000000000000000000000000000000000..feff195beb86a10936b8d227cda782ea44c92e02 --- /dev/null +++ b/changelogs/unreleased/52472-pipeline-endpoint-json.yml @@ -0,0 +1,5 @@ +--- +title: Fix caching issue with pipelines URL +merge_request: 22293 +author: +type: fixed diff --git a/spec/javascripts/jobs/store/actions_spec.js b/spec/javascripts/jobs/store/actions_spec.js index 5ab1f75d0d6b42eaa973fd7a33be7d2315850203..ce07effba9ec5351b6a52c9e0c0411ea0f636a06 100644 --- a/spec/javascripts/jobs/store/actions_spec.js +++ b/spec/javascripts/jobs/store/actions_spec.js @@ -422,7 +422,7 @@ describe('Job State actions', () => { beforeEach(() => { mockedState.job.pipeline = { - path: `${TEST_HOST}/endpoint.json/stages`, + path: `${TEST_HOST}/endpoint`, }; mock = new MockAdapter(axios); }); @@ -434,7 +434,7 @@ describe('Job State actions', () => { describe('success', () => { it('dispatches requestStages and receiveStagesSuccess, fetchJobsForStage ', done => { mock - .onGet(`${TEST_HOST}/endpoint.json/stages`) + .onGet(`${TEST_HOST}/endpoint.json`) .replyOnce(200, { details: { stages: [{ id: 121212, name: 'build' }] } }); testAction(