CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/cartodb/old_common/urls/organization_url.js

Summary

Maintainability
A
3 hrs
Test Coverage
/**
 * URL for a map (derived vis).
 */
cdb.common.OrganizationUrl = cdb.common.Url.extend({

  edit: function(user) {
    if (!user) {
      throw new Error('User is needed to create the url');
    }
    return this.urlToPath(user.get('username') + '/edit');
  },

  create: function() {
    return this.urlToPath('new');
  },

  groups: function() {
    return this.urlToPath('groups');
  }

});