'use strict';

angular.module('app').service('messageService', ['$http', '$cookies', '$location', 'userService', function($http, $cookies, $location, userService) {
    var self = this;

    this.submit = function(bundle, successCallback, failsCallback) {
        bundle.userId = userService.getMe().Id;
        $http.post($location.protocol() + '://' + $location.host() + ':' + $location.port() + '/api/bundle', bundle).then(successCallback, failsCallback);
    }
}]);