Skip to content

Commit

Permalink
cky ckeys
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Aug 5, 2024
1 parent 1f52761 commit 8ebfe5e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/userLookup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ export const LookupMenu: React.FC<LookupMenuProps> = (
const updateUser = useCallback(
(args: UpdateUserArguments) => {
const { userCkey, userDiscordId } = args;

setLoading(true);
const re = /[\\^]|[^a-z0-9@]/;
const userCkeyChecked = userCkey?.toLowerCase().replace(re, "");
callApi(
userCkey ? `/User?ckey=${userCkey}` : `/User?discordId=${userDiscordId}`
userCkeyChecked
? `/User?ckey=${userCkeyChecked}`
: `/User?discordId=${userDiscordId}`
).then((value) => {
setLoading(false);
if (value.status == 404) {
Expand Down

0 comments on commit 8ebfe5e

Please sign in to comment.