diff options
| author | Pitu <[email protected]> | 2019-04-24 09:28:30 +0000 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-04-24 09:28:30 +0000 |
| commit | c074b5e1971c26a69c3f4801f92e8a1c1ad072cd (patch) | |
| tree | faabb833f31da6859cb7e325950119ca87d38752 /src/api/structures | |
| parent | Fix when response is not an object (diff) | |
| download | host.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.js | 3 |
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; |