Skip to content

Instantly share code, notes, and snippets.

@acmisiti
Created February 27, 2014 20:26
Show Gist options
  • Save acmisiti/9258821 to your computer and use it in GitHub Desktop.
Save acmisiti/9258821 to your computer and use it in GitHub Desktop.
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