diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-07-02 18:14:32 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-07-02 18:14:32 +0200 |
commit | 178e900fb843f29c70771226109278451fc15087 (patch) | |
tree | be15a78eb231ba60e468aa3adba62f54b26e3394 /routes | |
parent | 7d5116f6f6096a9f37c4c71635dc570b7048c992 (diff) | |
download | example-collection-json-db-178e900fb843f29c70771226109278451fc15087.tar.gz example-collection-json-db-178e900fb843f29c70771226109278451fc15087.tar.bz2 example-collection-json-db-178e900fb843f29c70771226109278451fc15087.tar.xz example-collection-json-db-178e900fb843f29c70771226109278451fc15087.zip |
o Adding employee search.
Diffstat (limited to 'routes')
-rw-r--r-- | routes/index.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/routes/index.js b/routes/index.js index 969c0b8..44feab4 100644 --- a/routes/index.js +++ b/routes/index.js @@ -225,8 +225,17 @@ exports.employees = function(req, res) { } var c = {collection: { href: res.urlgenerator.employees(req.query), - items: mapEmployees(res, rs2.rows), - links: links + links: links, + queries: [{ + href: res.urlgenerator.employees(), + rel: 'search', + name: 'employee-search', + prompt: 'Employee search', + data: [ + { name: "name" } + ] + }], + items: mapEmployees(res, rs2.rows) }}; res.contentType('application/vnd.collection+json'); res.send(JSON.stringify(collection_json.fromObject(c)), 200); |