2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
22 import Configuration from 'sdc-app/config/Configuration.js';
24 import SoftwareProductActionHelper from 'sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js';
25 import {actionTypes} from './SoftwareProductCreationConstants.js';
29 const restPrefix = Configuration.get('restPrefix');
30 return `${restPrefix}/v1.0/vendor-software-products/`;
33 function createSoftwareProduct(softwareProduct) {
34 return RestAPIUtil.create(baseUrl(), {
41 const SoftwareProductCreationActionHelper = {
44 SoftwareProductActionHelper.loadSoftwareProductAssociatedData(dispatch);
46 type: actionTypes.OPEN
52 type: actionTypes.RESET_DATA
56 changeData(dispatch, {deltaData}) {
58 type: actionTypes.DATA_CHANGED,
63 createSoftwareProduct(dispatch, {softwareProduct}) {
64 return createSoftwareProduct(softwareProduct).then(response => {
65 SoftwareProductActionHelper.addSoftwareProduct(dispatch, {
71 return response.vspId;
77 export default SoftwareProductCreationActionHelper;