/** * 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(); }); } }