Created
February 27, 2014 20:26
-
-
Save acmisiti/9258821 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
Staff model which creates resource uri and passes "'?type=consultant'" if is_consultant flag is true. | |
TCB.Models.StaffModel = Backbone.Model.extend({ | |
urlRoot : function(){ | |
return '/m/api/v1/user/' + this.get('id') + '/'; | |
}, | |
url : function(){ | |
if(this.get('is_consultant')){ | |
return this.urlRoot() + '?type=consultant'; | |
} | |
else{ | |
return this.urlRoot(); | |
} | |
}, | |
defaults: function() { | |
return { | |
active : true, | |
visible : true, | |
}; | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment