aboutsummaryrefslogtreecommitdiff
path: root/src/api/structures
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-04-24 09:28:30 +0000
committerPitu <[email protected]>2019-04-24 09:28:30 +0000
commitc074b5e1971c26a69c3f4801f92e8a1c1ad072cd (patch)
treefaabb833f31da6859cb7e325950119ca87d38752 /src/api/structures
parentFix when response is not an object (diff)
downloadhost.fuwn.me-c074b5e1971c26a69c3f4801f92e8a1c1ad072cd.tar.xz
host.fuwn.me-c074b5e1971c26a69c3f4801f92e8a1c1ad072cd.zip
Fix database value conversion
Diffstat (limited to 'src/api/structures')
-rw-r--r--src/api/structures/Route.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/structures/Route.js b/src/api/structures/Route.js
index cb2878b..c04c585 100644
--- a/src/api/structures/Route.js
+++ b/src/api/structures/Route.js
@@ -25,7 +25,8 @@ const db = require('knex')({
const processResponse = row => {
Object.keys(row).forEach(key => {
if (booleanFields.includes(key)) {
- row[key] = row[key] === 1 ? true : false;
+ if (row[key] === 0) row[key] = false;
+ else if (row[key] === 1) row[key] = true;
}
});
return row;