Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchagain is not a function #58

Open
VivekLumbhani opened this issue Mar 26, 2024 · 1 comment
Open

fetchagain is not a function #58

VivekLumbhani opened this issue Mar 26, 2024 · 1 comment

Comments

@VivekLumbhani
Copy link

when i try updating name of the group chat(renaming of group) it says fetchagain is not a function
const handleRename = async () => {
if (!groupChatName) return;

    try {
      setrenameLoading(true);
      const config = {
        headers: {
          Authorization: `Bearer ${user.token}`
        }
      };
      console.log("renamet to "+groupChatName);
      var variable={
        "chatId": selectedChat._id,
        "name": groupChatName
      }
      console.log("details to rename "+JSON.stringify(variable));
      const { data } = await axios.put("/api/chat/rename", {
        chatId: selectedChat._id,
        name: groupChatName
      }, config);

  
      console.log("Rename Success:", data); 
      setSelectedChat(data);
      setFetchAgain(!fetchAgain);
      setrenameLoading(false);
      toast({
          title: "done renaming",
          status: "success",
          duration: 5000,
          isClosable: true,
          position: "bottom",
      });
    
    } catch (error) {
      console.log("error in renaming " + error);
      toast({
        title: "error in renaming",
        status: "error",
        duration: 5000,
        isClosable: true,
        position: "bottom",
      });
      setrenameLoading(false);
    }
    setgroupChatName("");
  };
  where is the problem ,have any one fixed this yet?
@yatin-kundra
Copy link

bro were you able to fix this , my chats name is not being rendered in my Chats column

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants