Skip to content

Allow custom relation path (http) - enable hasOne remoting access - #427

Merged
raymondfeng merged 2 commits into
strongloop:masterfrom
fabien:feature/relation-paths
Aug 7, 2014
Merged

Allow custom relation path (http) - enable hasOne remoting access#427
raymondfeng merged 2 commits into
strongloop:masterfrom
fabien:feature/relation-paths

Conversation

@fabien

@fabien fabien commented Aug 1, 2014

Copy link
Copy Markdown
Contributor

Specify options: { path: 'plural-name' } to set custom relation paths, regardless of as:

// Relation path setting - final api: /users/1/public-photos
User.hasMany('Photo', { 
  as: 'publicPhotos', 
  scope: { where: { public: true } }, 
  options: { path: 'public-photos' }
});

See also: loopbackio/loopback-datasource-juggler#199

raymondfeng added a commit that referenced this pull request Aug 7, 2014
Allow custom relation path (http) - enable hasOne remoting access
@raymondfeng
raymondfeng merged commit 0affc65 into strongloop:master Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants