UNPKG

tender

Version:

Tender API client

31 lines (23 loc) 735 B
// Generated by CoffeeScript 1.4.0 var Categories, async, tenderQuery; async = require('async'); tenderQuery = require('../tender_query'); module.exports = Categories = (function() { function Categories(client) { this.client = client; } Categories.prototype.get = function(options, callback) { this.options = options; this.options.uri = "" + this.client.baseURI + "/categories"; if (this.options.id) { this.options.uri = "" + this.options.uri + "/" + options.id; } return tenderQuery(this.client, this.options, function(err, data) { if (!data) { return callback(new Error("Category not found")); } return callback(err, data); }); }; return Categories; })();