Skip to content

Commit

Permalink
[frontend] Fixed function names and eliminated unnecessary argument
Browse files Browse the repository at this point in the history
  • Loading branch information
lim396 committed Feb 13, 2024
1 parent a8752b2 commit 90457e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/app/ui/room/ban-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export default function BanItem({
const router = useRouter();
const [isClicked, setIsClicked] = useState(false);

const onBan = async (userId: number) => {
const ban = async () => {
setIsClicked(true);
const result = await banUser(roomId, userId);
const result = await banUser(roomId, user.id);
if (result === "Success") {
router.refresh();
} else {
Expand All @@ -48,7 +48,7 @@ export default function BanItem({
{isClicked && <Loader className="ml-auto" />}
{!isClicked && (
<button
onClick={() => onBan(user.id)}
onClick={ban}
disabled={isClicked}
className="text-rose-500 ml-auto"
>
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/ui/room/unban-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export default function UnbanItem({
const router = useRouter();
const [isClicked, setIsClicked] = useState(false);

const onUnban = async (userId: number) => {
const unban = async () => {
setIsClicked(true);
const result = await unbanUser(roomId, userId);
const result = await unbanUser(roomId, user.id);
if (result === "Success") {
router.refresh();
} else {
Expand All @@ -49,7 +49,7 @@ export default function UnbanItem({
{isClicked && <Loader className="ml-auto" />}
{!isClicked && (
<button
onClick={() => onUnban(user.id)}
onClick={unban}
disabled={isClicked}
className="text-indigo-500 ml-auto"
>
Expand Down

0 comments on commit 90457e4

Please sign in to comment.