* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017 Amdocs
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 Amdocs
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
-
import {
POST,
POST_HEADER,
}
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));
dispatch(getSetGlobalMessageEvent(SUBSCRIPTION_FAILED_MESSAGE , MESSAGE_LEVEL_WARNING));
}
);
- };
}
export function getSubscriptionPayload() {
let externalfetchRequest =
- () => networkCall.getRequest(SUBSCRIPTION_PAYLOAD_URL, GET);
- return dispatch => {
- dispatch(fetchSubscriptionPayload(externalfetchRequest));
- };
+ () => networkCall.getRequest(SUBSCRIPTION_PAYLOAD_URL, GET);
+
+ return dispatch => dispatch(fetchSubscriptionPayload(externalfetchRequest));
}
function validateExternalParams(externalURLParams) {
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));
dispatch(getSetGlobalMessageEvent(FAILED_REQUEST , MESSAGE_LEVEL_DANGER));
}
);
- };
}
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 => {