From b6c01387f9bddf2d7419435c474baf70e9ff6617 Mon Sep 17 00:00:00 2001 From: HanJul_01 <129282275+Hanjuri@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:35:30 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EC=B1=84=ED=8C=85=EB=B0=A9=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=B1=84=EC=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/PeopleListCall.js | 13 +++++++++++++ src/pages/chat/ChatMain.jsx | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/api/PeopleListCall.js diff --git a/src/api/PeopleListCall.js b/src/api/PeopleListCall.js new file mode 100644 index 0000000..8f3fb05 --- /dev/null +++ b/src/api/PeopleListCall.js @@ -0,0 +1,13 @@ +import axios from "axios"; +import { instance } from "./instanceAuth.js"; + +export const PeopleListCall = async () => { + try { + const response = await instance.get(`/api/auth/member/all`); + console.log('apicall',response); + return response; + } catch (error) { + console.error("Error fetching PeopleList:", error.message); + throw error; + } +}; \ No newline at end of file diff --git a/src/pages/chat/ChatMain.jsx b/src/pages/chat/ChatMain.jsx index 891185b..992ee5e 100644 --- a/src/pages/chat/ChatMain.jsx +++ b/src/pages/chat/ChatMain.jsx @@ -10,7 +10,7 @@ import dummyChatList from "./dummyChatData/dummyChatList"; function ChatMain() { const [chatList, setChatList] = useState([]) const [selectedChatRoom, setSelectedChatRoom] = useState(null); - const nowUser = 'user1'; + const nowUser = localStorage.getItem("username");