huh
This commit is contained in:
@@ -8,6 +8,7 @@ import ContactsList from '../components/chat/ContactsList.tsx';
|
||||
import { initializeSocket, sendContact } from '../socket/socket.tsx';
|
||||
import Cookies from 'js-cookie';
|
||||
import { setStatus } from '../api/contactsApi.tsx';
|
||||
import { axiosClient } from '../App.tsx';
|
||||
|
||||
type ChatMessages = {
|
||||
sender: string;
|
||||
@@ -50,10 +51,19 @@ function Chat() {
|
||||
c.usernamecontact === newContact ? { ...c, read: true } : c,
|
||||
),
|
||||
);
|
||||
setStatus(newContact, true);
|
||||
|
||||
axiosClient
|
||||
.put(
|
||||
`api/chat/contacts/${newContact}`,
|
||||
{ status: true },
|
||||
{ withCredentials: true },
|
||||
)
|
||||
.then((res) => {
|
||||
console.log(res.data.message);
|
||||
})
|
||||
.catch((e) => console.log(e.response.data.message));
|
||||
console.log('Contact submitted:', newContact);
|
||||
}
|
||||
}
|
||||
|
||||
function updateStatus(contactObj: ContactObjProps, read: boolean) {
|
||||
setContactsList((prevContacts) =>
|
||||
|
||||
Reference in New Issue
Block a user