Created
November 7, 2013 23:02
-
-
Save jcreamer898/7363391 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
switch (invite.inviteType) { | |
case "connection": | |
inviteAction([invite], 'ignore').done(function () { | |
self.invitations.remove(invite); | |
TP.alert({ text: "Invite ignored!" }); | |
}); | |
return; | |
case "equipment": | |
GET({ url: '/ajax/equipment/invite-ignore', data: { inviteId: invite.id } }).done(function () { | |
self.invitations.remove(invite); | |
TP.alert({ text: "Invite ignored!" }); | |
}); | |
case "project": | |
GET({ url: '/ajax/projects/invite-ignore', data: { inviteId: invite.id } }).done(function () { | |
self.invitations.remove(invite); | |
TP.alert({ text: "Invite ignored!" }); | |
}); | |
return; | |
} |
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
var inviteTypes = { | |
connection: function() { | |
inviteAction([invite], 'ignore').done(function () { | |
self.invitations.remove(invite); | |
TP.alert({ text: "Invite ignored!" }); | |
}); | |
}, | |
equipment: function() { | |
GET({ url: '/ajax/equipment/invite-ignore', data: { inviteId: invite.id } }).done(function () { | |
self.invitations.remove(invite); | |
TP.alert({ text: "Invite ignored!" }); | |
}); | |
}, | |
project: function() { | |
GET({ url: '/ajax/projects/invite-ignore', data: { inviteId: invite.id } }).done(function () { | |
self.invitations.remove(invite); | |
TP.alert({ text: "Invite ignored!" }); | |
}); | |
} | |
}; | |
inviteTypes[invite.inviteType](); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment