Skip to content

Commit

Permalink
Fixed db2 example, recid should be LOWER
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebiroll committed Dec 19, 2017
1 parent 54ae25b commit 1242a0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 2 additions & 4 deletions server/node/db2/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The example uses Users and positions to demonstrate
Note that a user can only be at one posision, but there might be posisions without locataions

The example is not yet finnished but can serve as a starting point and example.
I have tried to reuse and look at the postgress node implementation foud here,
I have tried to reuse and look at the postgress node implementation found here,
http://w2ui.com/kickstart/

## Installation
Expand All @@ -19,7 +19,7 @@ To run the server with example client public/index.html

npm install

node server.js
node start.js

http://localhost:8080

Expand Down Expand Up @@ -49,7 +49,5 @@ In the top part you can generate users and later use them in the

When you have entered some data you can test the api with,

http://localhost:8080/api/enum/position

http://localhost:8080/api/enum/user

13 changes: 8 additions & 5 deletions server/node/db2/w2ui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Module that helps wo work with W2UI
* Module that helps to work with W2UI & db2
*
* DEPENDENCIES: underscore
*/
Expand Down Expand Up @@ -201,8 +201,6 @@ function serveDB2(req, res, collectionName)
var val = obj[key];
fields.push(key);
values.push(val);
// use val
console.log("Olle", key, val);
});

sql = sql + '(' ;
Expand Down Expand Up @@ -249,8 +247,8 @@ function serveDB2(req, res, collectionName)
break;
default:
{
console.log("Unknown cmd",evaluated.cmd)
var err_response = {
console.log("Unknown cmd",evaluated.cmd)
var err_response = {
status: "error",
message: "Command not recognized"
};
Expand Down Expand Up @@ -461,6 +459,11 @@ function getRecords (sql, req, res, options) {
if (master == null) master = record[options.master];
delete record[options.master];
}
if (record.RECID) {
record.recid = record.RECID
delete record.RECID;
console.log(record.recid)
}
data.push(record);
}
var ret = {
Expand Down

0 comments on commit 1242a0e

Please sign in to comment.