{"size": 776, "ext": "js", "max_stars_repo_path": "app/actions/ServiceActions.js", "max_stars_repo_name": "feelingTyper/react-alt", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/actions/ServiceActions.js", "max_issues_repo_name": "feelingTyper/react-alt", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/actions/ServiceActions.js", "max_forks_repo_name": "feelingTyper/react-alt", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.4761904762, "max_line_length": 49, "alphanum_fraction": 0.6288659794}
import alt from '../alt'
import {
	assign
} from 'underscore';

class ServiceActions {
	constructor() {
		this.generateActions(
			'setMessageSuccess',
			'setMessageFail',
			'getMessageSuccess',
			'getMessageFail'
		);
	}

	getDefaultMessage() {
		$.ajax({
			url: 'api/services',
			data: {}
		}).done((data) => {
			this.actions.getMessageSuccess(data);
		}).fail(() => {
			this.actions.getMessageFail(data);
		});
	}

	setMessage() {
		console.log('setMessage');
		$.ajax({
			url: 'api/setService',
			data: {}
		}).done((data) => {
			console.log('setMessage', data);
			this.actions.setMessageSuccess(data);
		}).fail((err) => {
			console.log('setMessageFail', err);
			this.actions.setMessageFail(err);
		});
	}
}

export default alt.createActions(ServiceActions);