fix integer checking

master
sigonasr2, Sig, Sigo 3 years ago
parent 3b84dcb51a
commit 4507b6696c
  1. 4
      server.js
  2. 4
      server_test.js

@ -1097,8 +1097,12 @@ function buildsGet(req,res,db) {
case "class2":{return "class2"}break; case "class2":{return "class2"}break;
} }
} }
if (filter_type=="class1"||filter_type=="class2") {
return `${filter_type?`where ${filter_type}=${filter}`:""}`
} else {
return `${filter_type?`where ${ConvertFilterType(filter_type)} ilike '%${filter}%'`:""}` return `${filter_type?`where ${ConvertFilterType(filter_type)} ilike '%${filter}%'`:""}`
} }
}
function SortQuery(sort_type){ function SortQuery(sort_type){
function ConvertSortType(sor) { function ConvertSortType(sor) {
switch (sor) { switch (sor) {

@ -1051,8 +1051,12 @@ function buildsGet(req,res,db) {
case "class2":{return "class2"}break; case "class2":{return "class2"}break;
} }
} }
if (filter_type=="class1"||filter_type=="class2") {
return `${filter_type?`where ${filter_type}=${filter}`:""}`
} else {
return `${filter_type?`where ${ConvertFilterType(filter_type)} ilike '%${filter}%'`:""}` return `${filter_type?`where ${ConvertFilterType(filter_type)} ilike '%${filter}%'`:""}`
} }
}
function SortQuery(sort_type){ function SortQuery(sort_type){
function ConvertSortType(sor) { function ConvertSortType(sor) {
switch (sor) { switch (sor) {

Loading…
Cancel
Save