cessmestreet
cessmestreet

Reputation: 2318

Sails JS actions2 req, res undefined

I have been extracting req and res using this format:

fn: async function(inputs, exits, { req, res }) {...}

I didn't have any problem until I deleted package-lock.json and tried to reinstall everything. Suddenly I get undefined req and res. It's weird because when I use an env variable and then extract req and res from it like so:

fn: async function(inputs, exits, env) { let {req, res} = env ...}

everything works. Can someone enlighten me what caused this issue?

Upvotes: 1

Views: 813

Answers (1)

fardin
fardin

Reputation: 1477

Based on this doc, POST has been replaced by PUT (WHY??!!). Once you use PUT as your http verb, parameters show up in the controller.

Upvotes: 1

Related Questions