Skip to content

Commit faa009c

Browse files
committed
♻️ refactor : Modify the Change Nickname API
Change a static value to dynamic Related issue: #128
1 parent a209e4c commit faa009c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/navbar/profile/Profile.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ const Profile = () => {
4747

4848
const toggleDropdown = () => {
4949
setDropdownOpen(!dropdownOpen);
50-
console.log(params);
5150
};
5251

5352
const handleEditName = (name: string) => {
5453
setDropdownOpen(false);
55-
putUserName(user.id, 4, name);
54+
putUserName(user.id, parseInt(params.cId), name).then(() => {
55+
setUser(prevUser => ({
56+
...prevUser,
57+
name: name,
58+
}));
59+
});
5660
};
5761

5862
const handleClickDelete = () => {

0 commit comments

Comments
 (0)