Files
dbois/public/js/lib/dataservices/commentsDataservice.js
T
2018-01-11 08:54:51 +01:00

40 lines
1.1 KiB
JavaScript

/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 10/01/2018
* Time: 14:18
*/
dbo.commentsDataService = {
getComments: function ( foreignID, tablename, callback ) {
$.getJSON( 'index.php/projects/commentsController/getComments/' + foreignID + '/' + tablename )
.done( function ( data ) {
callback( data );
} );
},
getComment:function(commentID, callback){
$.getJSON( 'index.php/projects/commentsController/getComment/' + commentID )
.done( function ( data ) {
callback( data );
} );
},
addComment: function ( foreignID, tablename, callback ) {
$.getJSON( 'index.php/projects/commentsController/addComment/' + foreignID + '/' + tablename )
.done( function (data) {
callback(data);
} );
},
saveComment:function(commentID, comment, callback){
$.post('index.php/projects/commentsController/saveComment/' + commentID, {comment:comment} )
.done(function(){
callback();
});
}
}