aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-07-02 18:14:32 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-07-02 18:14:32 +0200
commit178e900fb843f29c70771226109278451fc15087 (patch)
treebe15a78eb231ba60e468aa3adba62f54b26e3394
parent7d5116f6f6096a9f37c4c71635dc570b7048c992 (diff)
downloadexample-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.
-rw-r--r--routes/index.js13
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);