use me link of index resource

This commit is contained in:
Maren Süwer
2018-10-11 10:26:54 +02:00
parent 8b7dcc379b
commit ae92842763
5 changed files with 27 additions and 17 deletions

View File

@@ -21,12 +21,16 @@ export const FETCH_INDEXRESOURCES_FAILURE = `${FETCH_INDEXRESOURCES}_${
const INDEX_RESOURCES_LINK = "/";
export const callFetchIndexResources = (): Promise<IndexResources> => {
return apiClient.get(INDEX_RESOURCES_LINK).then(response => {
return response.json();
});
};
export function fetchIndexResources() {
return function(dispatch: any) {
dispatch(fetchIndexResourcesPending());
return apiClient
.get(INDEX_RESOURCES_LINK)
.then(response => response.json())
return callFetchIndexResources()
.then(resources => {
dispatch(fetchIndexResourcesSuccess(resources));
})