Skip to content

Instantly share code, notes, and snippets.

@joelbrewer
Last active August 26, 2015 04:44
Show Gist options
  • Save joelbrewer/9fcdbd23ef3d0bd2d019 to your computer and use it in GitHub Desktop.
Save joelbrewer/9fcdbd23ef3d0bd2d019 to your computer and use it in GitHub Desktop.
$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