Example #1
0
	hagamosLaFiesta: function(fiestaObj) {
		Backendless.UserService.getCurrentUser().then(function(usr){
			console.log(usr)
			// add host data to party
			fiestaObj.host = usr
			var newFiesta = new Fiesta(fiestaObj)

			
			// // add party to hosts events
			console.log(1)
			// usr.events.push(newFiesta)
			
			// // update the party and the user
			// Backendless.UserService.update(usr)
			Backendless.Persistence.of(Fiesta).save(newFiesta).then(function(){
				Backbone.Events.trigger('poll')
			},
			function(err){
				console.log(err)
			})
		},
		function(err){
			console.log(err)
		})
	},
Example #2
0
	bienvenidos: function(userData) {
		console.log(userData)
		var usr = new Backendless.User() 
		usr = _.extend(usr,userData)
		Backendless.UserService.register(usr).then(function(resp){
			console.log(resp)
			Backendless.UserService.login(userData.email,userData.password).then(function(){
				location.hash = "eventDash"
			})
		})
	},
Example #3
0
	quePedo: function(email,password) {
		Backendless.UserService.login( email, password, true ).then(function(resp){
			console.log(resp)
			location.hash = "eventDash"
		});
	},
Example #4
0
		Backendless.UserService.register(usr).then(function(resp){
			console.log(resp)
			Backendless.UserService.login(userData.email,userData.password).then(function(){
				location.hash = "eventDash"
			})
		})
Example #5
0
	adios: function() {
		Backendless.UserService.logout()
		location.hash = "login"
	},