Last active
August 26, 2015 04:44
-
-
Save joelbrewer/9fcdbd23ef3d0bd2d019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.acceptAppointment = function(currentAppointment) { | |
var newAppointment = {} | |
if (userIsAppointmentrealtor() === true) { | |
newAppointment.confirmed_by_realtor = true; | |
} else { | |
newAppointment.status = "confirmed"; | |
} | |
newAppointment.id = currentAppointment.id; | |
// Update the appointment | |
AppointmentService.update(newAppointment).then(function() { | |
alert('Accepted'); | |
refreshData(); | |
}); | |
} | |
function userIsAppointmentRealtor(user, appointment) { | |
return user.id === appointment.realtor.id; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment