import Constants from '../helper/Constants.jsx';
import axios from 'axios';
axios.defaults.headers.common['Authorization'] = localStorage.token;
axios.defaults.headers.common['token'] = localStorage.token;

/**
*@getSchemas
*/
const getSchemas = (params) => {
	return axios.get(Constants.URL_SCHEMAS,{params});
}
/**
*@removeSchema
*/
const removeSchema = (_id) => {
	return axios.delete(Constants.URL_SCHEMA+"/"+_id);
}
/**
*@getDbPools
*/
const getDbPools = () => {
	return axios.get(Constants.URL_GET_POOLS);
}
/**
*@changeActiveGroup
*/
const changeActiveGroup = (active_group) => {
	return axios.get(Constants.URL_CHANGE_ACTIVE_GROUP,{
		params: {
			active_group
		}
	});
}
/**
*@get_current_active_group
*/
const get_current_active_group = (active_group) => {
	return axios.get(Constants.URL_GET_CURRENT_ACTIVE_GROUP);
}
/**
*@add_new_project
*/
const add_new_project = (params) => {
	return axios.post(Constants.URL_ADD_PRJECT,params);
}
/**
*@install_database
*/
const install_database = (params) => {
	return axios.post(Constants.URL_INSTALL,params);
}
export {
	getSchemas,
	getDbPools,
	removeSchema,
	changeActiveGroup,
	get_current_active_group,
	add_new_project,
	install_database
}