From c074b5e1971c26a69c3f4801f92e8a1c1ad072cd Mon Sep 17 00:00:00 2001 From: Pitu Date: Wed, 24 Apr 2019 09:28:30 +0000 Subject: Fix database value conversion --- src/api/structures/Route.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/api') 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; -- cgit v1.2.3