diff --git a/scm-ui/src/repos/modules/repos.js b/scm-ui/src/repos/modules/repos.js index cad3ea5d93..ccf6bf4f4e 100644 --- a/scm-ui/src/repos/modules/repos.js +++ b/scm-ui/src/repos/modules/repos.js @@ -10,12 +10,13 @@ export const FETCH_REPOS_SUCCESS = `${FETCH_REPOS}_${types.SUCCESS_SUFFIX}`; export const FETCH_REPOS_FAILURE = `${FETCH_REPOS}_${types.FAILURE_SUFFIX}`; const REPOS_URL = "repositories"; +const SORT_BY = "sortBy=namespaceAndName"; export function fetchRepos() { return function(dispatch: any) { dispatch(fetchReposPending()); return apiClient - .get(REPOS_URL) + .get(`${REPOS_URL}?${SORT_BY}`) .then(response => response.json()) .then(repositories => { dispatch(fetchReposSuccess(repositories)); diff --git a/scm-ui/src/repos/modules/repos.test.js b/scm-ui/src/repos/modules/repos.test.js index 272cf9dad6..4ba12d13fa 100644 --- a/scm-ui/src/repos/modules/repos.test.js +++ b/scm-ui/src/repos/modules/repos.test.js @@ -194,7 +194,7 @@ const repositoryCollectionWithNames: RepositoryCollection = { }; describe("repos fetch", () => { - const REPOS_URL = "/scm/api/rest/v2/repositories"; + const REPOS_URL = "/scm/api/rest/v2/repositories?sortBy=namespaceAndName"; const mockStore = configureMockStore([thunk]); afterEach(() => {