summaryrefslogtreecommitdiff
path: root/nodejs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nodejs/database/agents.js2
-rw-r--r--nodejs/database/contracts.js2
-rw-r--r--nodejs/database/surveys.js3
3 files changed, 4 insertions, 3 deletions
diff --git a/nodejs/database/agents.js b/nodejs/database/agents.js
index fe24d8c..4dd7f4b 100644
--- a/nodejs/database/agents.js
+++ b/nodejs/database/agents.js
@@ -12,5 +12,5 @@ export function getAgent() {
if (data === undefined) {
return null;
}
- return data.data;
+ return JSON.parse(data.data);
}
diff --git a/nodejs/database/contracts.js b/nodejs/database/contracts.js
index 8790701..ac583de 100644
--- a/nodejs/database/contracts.js
+++ b/nodejs/database/contracts.js
@@ -9,7 +9,7 @@ export function getContract(id) {
if (data === undefined) {
return null;
}
- return data.data;
+ return JSON.parse(data.data);
}
export function setContract(data) {
diff --git a/nodejs/database/surveys.js b/nodejs/database/surveys.js
index 60c85b2..3397374 100644
--- a/nodejs/database/surveys.js
+++ b/nodejs/database/surveys.js
@@ -10,7 +10,8 @@ export function deleteExpired() {
export function get(symbol) {
deleteExpired();
- return getSurveysStatement.all(symbol);
+ const data = getSurveysStatement.all(symbol);
+ return data.map(elt => JSON.parse(elt.data));
}
export function set(survey) {