UNPKG

battlenet-api

Version:

A Node.JS library for the Battle.net Community Platform API

37 lines (27 loc) 771 B
/** * World of Warcraft Item API. */ module.exports = function(battlenet) { 'use strict'; return { item: function() { var args = battlenet.args.apply(null, arguments); var path = '/wow/item/' + args.params.id; if (args.params.context) { path += '/' + args.params.context; } if (args.params.bonusList) { args.config.qs = { bl: args.params.bonusList.toString() }; } args.params.path = path; battlenet.fetch(args.params, args.config, args.callback); }, set: function() { var args = battlenet.args.apply(null, arguments); args.params.path = '/wow/item/set/' + args.params.id; battlenet.fetch(args.params, args.config, args.callback); } }; };