From e590b3f8236b839fa9f9b93c21388a88f2642916 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 30 Oct 2023 23:41:58 +0100 Subject: [PATCH] adapt search for endpoint --- web/js/library.js | 14 ++++++-------- web/js/users.js | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/web/js/library.js b/web/js/library.js index 2a5b6a8..4fd381c 100644 --- a/web/js/library.js +++ b/web/js/library.js @@ -31,19 +31,19 @@ function buildParam(e, id){ if(id == "inputRoles"){ var status = e.target.value; if(status != "-2"){ - param = param + "key=status&value="+status+"&"; + param = param + "status="+status+"&"; } if(getId != "All"){ - param = param + "key=roles&value="+getId; + param = param + "roles="+getId; } } if(id == "inputStatus"){ var roles = e.target.value; if(getId != "-2"){ - param = param + "key=status&value="+getId+"&"; + param = param + "status="+getId+"&"; } if(roles != "All"){ - param = param + "key=roles&value="+roles+"&"; + param = param + "roles="+roles+"&"; } } } else { @@ -54,13 +54,11 @@ function buildParam(e, id){ if(search.length > 0){ if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(search)){ param = param + "email="+search+"&"; - } else if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(search)){ - param = param + "uuid="+search+"&"; } else { - param = param + "search="+search+"&"; + param = param + "id="+search+"&"; } } else { - listParam.push("email"); listParam.push("uuid"); listParam.push("search"); + listParam.push("email"); listParam.push("id"); } for (var i=0; i 0){ param["skip"] = param["skip"] - 1; } -var listQuery = ["search", "uuid", "roles", "status", "email"]; +var listQuery = ["search", "id", "roles", "status", "email"]; for (var i=0; i 0){ @@ -83,7 +83,7 @@ for (var i=0; i