Skip to content

Commit

Permalink
Add support for specifying a description field.
Browse files Browse the repository at this point in the history
  • Loading branch information
martindale committed May 29, 2016
1 parent db41e89 commit 4b3c0d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/Resource/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var Resource = function( name , options ) {
if (!options.requires) options.requires = [];
if (!options.handlers) options.handlers = {};
if (!options.params) options.params = { query: {} };
if (!options.fields) options.fields = {};
if (!options.attributes) options.attributes = {};
if (!options.names) options.names = {};

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ HTTP.prototype.provide = function() {

var stub = {
title: resource.names[req.m + 'Proper'] + ' on ' + self.maki.config.service.name,
description: resource.description
description: (resource.options.fields.description) ? data[resource.options.fields.description] : resource.description
};

console.log('stub:', stub);
Expand Down
5 changes: 4 additions & 1 deletion maki.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ var Person = maki.define('Person', {
query: {
limit: 1000
}
},
fields: {
description: 'bio'
}
});

Expand Down Expand Up @@ -106,7 +109,7 @@ maki.define('Release', {
published: { type: Date },
notes: { type: String , render: 'markdown' }
},
source: 'https://api.github.com/repos/martindale/maki/releases',
//source: 'https://api.github.com/repos/martindale/maki/releases',
icon: 'tags',
map: function( release ) {
return {
Expand Down

0 comments on commit 4b3c0d5

Please sign in to comment.