mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 18:51:10 +01:00
order repositories by namespace and name
This commit is contained in:
@@ -10,12 +10,13 @@ export const FETCH_REPOS_SUCCESS = `${FETCH_REPOS}_${types.SUCCESS_SUFFIX}`;
|
|||||||
export const FETCH_REPOS_FAILURE = `${FETCH_REPOS}_${types.FAILURE_SUFFIX}`;
|
export const FETCH_REPOS_FAILURE = `${FETCH_REPOS}_${types.FAILURE_SUFFIX}`;
|
||||||
|
|
||||||
const REPOS_URL = "repositories";
|
const REPOS_URL = "repositories";
|
||||||
|
const SORT_BY = "sortBy=namespaceAndName";
|
||||||
|
|
||||||
export function fetchRepos() {
|
export function fetchRepos() {
|
||||||
return function(dispatch: any) {
|
return function(dispatch: any) {
|
||||||
dispatch(fetchReposPending());
|
dispatch(fetchReposPending());
|
||||||
return apiClient
|
return apiClient
|
||||||
.get(REPOS_URL)
|
.get(`${REPOS_URL}?${SORT_BY}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(repositories => {
|
.then(repositories => {
|
||||||
dispatch(fetchReposSuccess(repositories));
|
dispatch(fetchReposSuccess(repositories));
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ const repositoryCollectionWithNames: RepositoryCollection = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
describe("repos fetch", () => {
|
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]);
|
const mockStore = configureMockStore([thunk]);
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user