kwent / syno

Simple Node.js wrapper and CLI for Synology DSM REST API 5.x and 6.x.
http://kwent.github.io/syno
MIT License
316 stars 51 forks source link

Error 500 on fs getMethods #53

Closed Afondevi closed 4 years ago

Afondevi commented 4 years ago

Hello,

getting 500, don't know why :

 GET /nas/fs/getMethods 500 6.580 ms - 4591
[watch:server] TypeError: done is not a function
[watch:server]     at FileStation.getMethods (/Users/alexyfondeville/Desktop/Afondevi-All-Project/nasaf-webresources-api/node_modules/syno/dist/syno.js:489:26)
...

running that :

static getMethodsFs(req, res){
      syno.fs.getMethods((error, methods) => {
        if (error) {
          return res.json(error);
        }
        return res.json(methods);
      });
    }
Afondevi commented 4 years ago

That's my fault, getMethods need one params like :

syno.fs.getMethods({}, (error, methods) => {
        if (error) {
          return res.json(error);
        }
        return res.json(methods);
      });