xbenjii / Prestan

PrestaShop Node.js API Library [UNMAINTAINED]
MIT License
20 stars 7 forks source link

delete implementation #7

Closed mccreadylemon closed 8 years ago

mccreadylemon commented 8 years ago

Hello, is delete implemented? I get [TypeError: Object function request(uri, options, callback) { if (typeof uri === 'undefined') { throw new Error('undefined is not a valid uri or options object.') }

var params = initParams(uri, options, callback)

if (params.method === 'HEAD' && paramsHaveRequestBody(params)) { throw new Error('HTTP HEAD requests MUST NOT include a request body.') }

return new request.Request(params) } has no method 'delete']

mccreadylemon commented 8 years ago

also here is my code

prestan.delete('addresses', {id:3} ).then(function(response){ console.log(response); }).catch(function(error) { console.log(error); });

xbenjii commented 8 years ago

Delete is implemented yes, can you post the full code snippet you're using?

mccreadylemon commented 8 years ago

is the above syntax correct? thanks

xbenjii commented 8 years ago

The code looks correct, but can you post the code you're using to require and instantiate the library?

mccreadylemon commented 8 years ago

var config = require('./config'), Prestan = require('prestan'), options = {debug: config.production ? false : true}, prestan = new Prestan(config.remoteUrl, config._APIKEY , options);

module.exports = prestan;

mccreadylemon commented 8 years ago

any update?

xbenjii commented 8 years ago

Can't reproduce it, sorry.

liferus commented 8 years ago

node_modules/prestan/index.js line #177: return this.executeRequest('delete', url).then(function (response) { replace: return this.executeRequest('del', url).then(function (response) {

xbenjii commented 8 years ago

@liferus That's wrong. Closing this anyway.

mccreadylemon commented 8 years ago

actually that worked! thanks!