d-pac / restful-keystone

Automatic RESTful API enabler for KeystoneJS
MIT License
160 stars 50 forks source link

Slug based ID added on retrieve method. #12

Closed fmedinac closed 6 years ago

htor commented 8 years ago

This should definitely be merged. A lot of use cases require semantic URLs in the front-end, not exposing the underlying IDs from a database.

I assume this works only for schemas that have an autokey with path: 'slug'? Like this one:

var Thing = new keystone.List('Thing', {
    autokey: { path: 'slug', from: 'title', unique: true }
}); 
EduardoAC commented 8 years ago

What happens if any user change the path text as keystone-demo does?

fmedinac commented 6 years ago

Cleaning too old PR.