summaryrefslogtreecommitdiffstats
path: root/src/app/contextHandler/ContextHandlerActions.js
diff options
context:
space:
mode:
authorandrzejszukuc <andrzej.szukuc@nokia.com>2019-02-14 13:38:12 +0100
committerandrzejszukuc <andrzej.szukuc@nokia.com>2019-02-15 12:19:03 +0100
commit27fe29a076553c26e2c56dccaf52d2af789eae3a (patch)
tree412c53b55650f952a7bfed66bcd17d614fd2c009 /src/app/contextHandler/ContextHandlerActions.js
parent20d0dc060ba6b264b82a265c487d350e498a5135 (diff)
Integration tests for MainScreenWrapperReducer
Change-Id: I7e947ea2ccab8877a3b8bb01d8e6b999bee1901f Issue-ID: AAI-2143 Signed-off-by: Andrzej Szukuc <andrzej.szukuc@nokia.com>
Diffstat (limited to 'src/app/contextHandler/ContextHandlerActions.js')
-rw-r--r--src/app/contextHandler/ContextHandlerActions.js22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/app/contextHandler/ContextHandlerActions.js b/src/app/contextHandler/ContextHandlerActions.js
index f3ede6d..35091b5 100644
--- a/src/app/contextHandler/ContextHandlerActions.js
+++ b/src/app/contextHandler/ContextHandlerActions.js
@@ -81,8 +81,7 @@ function createSubscriptionPayloadEvent(payload) {
}
function fetchSubscriptionPayload(fetchRequestCallback) {
- return dispatch => {
- return fetchRequestCallback().then(
+ return dispatch => fetchRequestCallback().then(
(response) => {
if (response.status >= STATUS_CODE_3XX_REDIRECTION) {
return Promise.reject(new Error(response.status));
@@ -100,16 +99,13 @@ function fetchSubscriptionPayload(fetchRequestCallback) {
dispatch(getSetGlobalMessageEvent(SUBSCRIPTION_FAILED_MESSAGE , MESSAGE_LEVEL_WARNING));
}
);
- };
}
export function getSubscriptionPayload() {
let externalfetchRequest =
() => networkCall.getRequest(SUBSCRIPTION_PAYLOAD_URL, GET);
- return dispatch => {
- dispatch(fetchSubscriptionPayload(externalfetchRequest));
- };
+ return dispatch => dispatch(fetchSubscriptionPayload(externalfetchRequest));
}
function validateExternalParams(externalURLParams) {
@@ -129,8 +125,8 @@ function createSuggestionFoundEvent(suggestion) {
function fetchDataForExternalRequest(fetchRequestCallback) {
- return dispatch => {
- return fetchRequestCallback().then(
+ return dispatch =>
+ fetchRequestCallback().then(
(response) => {
if (response.status === STATUS_CODE_204_NO_CONTENT || response.status >= STATUS_CODE_3XX_REDIRECTION) {
return Promise.reject(new Error(response.status));
@@ -158,7 +154,6 @@ function fetchDataForExternalRequest(fetchRequestCallback) {
dispatch(getSetGlobalMessageEvent(FAILED_REQUEST , MESSAGE_LEVEL_DANGER));
}
);
- };
}
function validateAndFetchExternalParams(externalParams) {
@@ -172,17 +167,12 @@ function validateAndFetchExternalParams(externalParams) {
let externalfetchRequest =
() => networkCall.fetchRequestObj(EXTERNAL_REQ_ENTITY_SEARCH_URL, POST,
POST_HEADER, postBody);
- return dispatch => {
- dispatch(fetchDataForExternalRequest(externalfetchRequest));
- };
+ return dispatch => dispatch(fetchDataForExternalRequest(externalfetchRequest));
}
}
export function externalUrlRequest(urlParams) {
let externalURLParams = getExternalParamValues(urlParams);
- return dispatch => {
- dispatch(
- validateAndFetchExternalParams(externalURLParams));
- };
+ return dispatch => dispatch(validateAndFetchExternalParams(externalURLParams));
}
export function externalMessageRequest(jsonParams) {
return dispatch => {