Skip to content

Commit

Permalink
Fixed searching a name with a single quote
Browse files Browse the repository at this point in the history
  • Loading branch information
Mstiekema committed Mar 18, 2024
1 parent 49cf081 commit 04a68be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin_board_view/static/AdminBoardView/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ const showUser = document.getElementById("show-user");
if (showUser) {
document.getElementById("show-user").addEventListener("click", e => {
const name = document.getElementById("user").value;
const escapedName = name.replace("'", "\\'");
const user_options = document.getElementById("userOptions");
const selected_user = user_options.querySelector(`[value='${name}']`);
const selected_user = user_options.querySelector(`[value='${escapedName}']`);
if (!selected_user) {
showToast("Show user - Failed", "User not found");
} else {
Expand Down

0 comments on commit 04a68be

Please sign in to comment.