diff options
author | Julien Dessaux | 2023-09-07 23:40:20 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-09-07 23:40:20 +0200 |
commit | a9cd987c50de7d49bb82cc1b4b9de3c449659630 (patch) | |
tree | ef2fb91299fdfb744897b005bd7b370ab34762cd | |
parent | [javascript] refactored ships and systems database interface (diff) | |
download | spacetraders-a9cd987c50de7d49bb82cc1b4b9de3c449659630.tar.gz spacetraders-a9cd987c50de7d49bb82cc1b4b9de3c449659630.tar.bz2 spacetraders-a9cd987c50de7d49bb82cc1b4b9de3c449659630.zip |
[javascript] Fixed database functions result which were not parsed
-rw-r--r-- | nodejs/database/agents.js | 2 | ||||
-rw-r--r-- | nodejs/database/contracts.js | 2 | ||||
-rw-r--r-- | nodejs/database/surveys.js | 3 |
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) { |