Updated the api to include the latest changes, fixed the id of the api-method-index, moved the index out of the
existing menu as to prevent the other options in the menu from being hidden. Added the options of an enum param to the docs.
This commit is contained in:
@ -66,11 +66,24 @@ module.exports = function (branch, done) {
|
||||
});
|
||||
|
||||
apiSpec = {
|
||||
actions: groups.normal,
|
||||
proxies: groups.proxies,
|
||||
actions: groups.normal || [],
|
||||
proxies: groups.proxies || [],
|
||||
namespaces: _.unique(namespaces.sort(), true)
|
||||
};
|
||||
|
||||
var create = _.assign({}, _.find(apiSpec.actions, { name: 'index' }), {
|
||||
name: 'create',
|
||||
location: 'create',
|
||||
proxy: 'index',
|
||||
transformBody: 'params.op_type = \'create\';'
|
||||
});
|
||||
|
||||
if (create.allParams && create.allParams.opType) {
|
||||
delete create.allParams.opType;
|
||||
}
|
||||
|
||||
apiSpec.proxies.push(create);
|
||||
|
||||
done();
|
||||
}
|
||||
|
||||
@ -100,6 +113,7 @@ module.exports = function (branch, done) {
|
||||
function formatDocVars(done) {
|
||||
// merge the actions and proxies to make
|
||||
// itteration easir and keep them in order
|
||||
|
||||
docVars = _.omit(apiSpec, 'proxies');
|
||||
docVars.actions = _.sortBy(
|
||||
[].concat(apiSpec.actions).concat(apiSpec.proxies),
|
||||
@ -293,11 +307,6 @@ module.exports = function (branch, done) {
|
||||
throw new Error('unable to pick a method for ' + JSON.stringify(action, null, ' '));
|
||||
}
|
||||
|
||||
if (action.name === 'create') {
|
||||
action.proxy = 'index';
|
||||
action.transformBody = 'params.op_type = \'create\';';
|
||||
}
|
||||
|
||||
actions.push(action);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user