File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " adonis-search" ,
3- "version" : " 1.0.1 " ,
3+ "version" : " 1.0.2 " ,
44 "description" : " Mail provider for adonis framework and has support for all common mailing services to send emails" ,
55 "main" : " index.js" ,
66 "directories" : {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const Database = use('Database')
77class Query {
88 static get INT ( ) { return 1 }
99 static get STRING ( ) { return 2 }
10+ static get INT_MAX_VALUE ( ) { return 2147483647 }
1011
1112 /**
1213 * @param {Object } request
@@ -80,7 +81,8 @@ class Query {
8081 }
8182
8283 const whereLike = ( column ) => {
83- builder . orWhere ( Database . raw ( `LOWER(${ column } )` ) , 'LIKE' , Database . raw ( `LOWER('%${ this . _query . search } %')` ) )
84+ const search = this . _query . search . toLowerCase ( )
85+ builder . orWhere ( Database . raw ( `LOWER(${ column } )` ) , 'LIKE' , `%${ search } %` )
8486 }
8587
8688 const whereEqual = ( column ) => {
@@ -93,7 +95,7 @@ class Query {
9395 } else {
9496 if ( column === this . constructor . INT ) {
9597 const valueInt = Number . parseInt ( this . _query . search )
96- if ( Number . isInteger ( valueInt ) ) {
98+ if ( Number . isInteger ( valueInt ) && valueInt <= this . constructor . INT_MAX_VALUE ) {
9799 whereEqual ( i )
98100 }
99101 } else {
You can’t perform that action at this time.
0 commit comments