
(function () {
    'use strict';
    angular.module('Monitour.pages.main')
        .factory('MainService', MainService);


    function MainService($http, $localStorage) {

        var service = {};
        service.GetAll = GetAll;


        var domain = 'https://api.callio.com.au/public/';

        return service;


        function GetAll() {
            return $http.get(domain + 'users/me').then(handleSuccess, handleError('Error getting all details'));
        }



        // private functions

        function handleSuccess(res) {
            return res.data;
        }

        function handleError(error) {
            return function () {
                return { success: false, message: error };
            };
        }
    }

})();