Skip to content

Commit

Permalink
fix(sql): allow null type for uniqueInsert
Browse files Browse the repository at this point in the history
  • Loading branch information
AlloVince committed Apr 19, 2018
1 parent ed58485 commit 8ead9af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/entities/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export default class Entities {
const typeAllowed = ['number', 'string', 'boolean'];
Object.entries(inputObj).forEach((p) => {
const valType = typeof p[1];
if (typeAllowed.indexOf(valType) === -1) {
//Allow null type here
if (typeAllowed.indexOf(valType) === -1 && p[1] !== null) {
throw new StandardException(`SQL inputObj ${p[0]}:${p[1]} with unsupported type ${valType}.`);
} else if (valType === 'boolean') {
if (p[1] === true) {
Expand Down

0 comments on commit 8ead9af

Please sign in to comment.