From 69c46aa6161742c7a6b177294d21b0294f9cd563 Mon Sep 17 00:00:00 2001 From: Andrew Carlson Date: Sat, 30 Sep 2017 11:15:29 -0400 Subject: [PATCH] fixing example in documentation to use req rather than res --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 1210257..cdb2f31 100644 --- a/readme.md +++ b/readme.md @@ -259,7 +259,7 @@ hooks.addPreHookForAllResources('get', function(req, res, dbClient, next) { // Will generate query with {read: 0} hooks.addPreHookForAllResources('getList', function(req, res, dbClient, next){ - res.pgRestifyWhere = {}; + req.pgRestifyWhere = {}; for (key in req.query){ switch (key){ case 'pageSize': @@ -268,7 +268,7 @@ hooks.addPreHookForAllResources('getList', function(req, res, dbClient, next){ case 'orderByDesc': break; default: - res.pgRestifyWhere[key] = req.query[key]; + req.pgRestifyWhere[key] = req.query[key]; } } return next();