Browse Source

Fix database value conversion

Pitu 6 years ago
parent
commit
c074b5e197
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/api/structures/Route.js

+ 2 - 1
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;