/** * Created by Pensare Software. * Offer: Theo Weijmer * Date: 25/12/2017 * Time: 09:50 */ dbo.offerDataService = { getAllOffers: function ( archive = 'F', callback ) { $.getJSON( 'index.php/beheer/offersController/getAllOffers/' + archive ) .done( function ( data ) { callback( data ); } ); }, getOffer: function ( userID, callback ) { $.getJSON( 'index.php/beheer/offersController/getOffer/' + userID ) .done( function ( data ) { callback( data ); } ); }, checkOffername: function ( username, callback ) { $.post( 'index.php/beheer/userController/checkOffername', 'json' ) .done( function ( data ) { console.log( data ); callback( data ); } ); }, saveOffer: function ( submitDATA, callback ) { $.post( 'index.php/beheer/offersController/saveOffer', submitDATA, function () { }, 'json' ) .done( function ( data ) { callback( data ); } ); }, archiveOffer: function ( userID, status, callback ) { $.get( 'index.php/beheer/offersController/archiveOffer/' + userID + '/' + status ) .done( function () { callback(); } ); }, removeOffer: function ( userID, callback ) { $.getJSON( 'index.php/beheer/offersController/removeOffer/' + userID ) .done( function ( data ) { callback( data ); } ); } }