/*!
 * Copyright © 2016-2018 European Support Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
import Configuration from 'sdc-app/config/Configuration.js';
import {actionTypes} from './FeaturesConstants.js';


function baseUrl() {
	const restPrefix = Configuration.get('restPrefix');
	return `${restPrefix}/v1.0/togglz`;
}

function fetchList() {
	return RestAPIUtil.fetch(baseUrl());
}

export default {
	getFeaturesList(dispatch) {
		return fetchList().then(response => {
			dispatch({
				type: actionTypes.FEATURES_LIST_LOADED,
				features: response.features
			});
		}).catch(() => console.error('An exception occured while trying to fetch the toggleZ features.') );
	}
};

