
app.factory('responsavelFactory', function ($http) {
    var url = '../api/responsavel/';
    var url_local = '../api/reslocal/';
    return {
        getResponsaveis: function () {
            return $http.get(url);
        },
       
        addResponsavel: function (responsavel) {


            return $http({
                cache: false,
                url: url,
                method: "POST",
                data: responsavel

            })
        },
        deleteResponsavel: function (responsavel) {

            return $http.delete(url + responsavel.Pk_Responsavel);
        },
        updateResponsavel: function (responsavel) {

            return $http.put(url + responsavel.Pk_Responsavel, responsavel);
        },

        getResLocal: function () {
            return $http.get(url_local);
        },

        addResLocal: function (reslocal) {


            return $http({
                cache: false,
                url: url_local,
                method: "POST",
                data: reslocal

            })
        },
        deleteResLocal: function (reslocal) {

            return $http.delete(url_local + reslocal.Pk_Local);
        },
        updateResLocal: function (reslocal) {

            return $http.put(url_local + reslocal.Pk_Local, reslocal);
        }
    };
});