no debil no
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
import { ChatMessagesProps, ContactsProps } from '@/types/types.ts';
|
||||
import { axiosClient } from '@/utils/axiosClient.ts';
|
||||
|
||||
export async function getContactsList(): Promise<ContactsProps[]> {
|
||||
try {
|
||||
const response = await axiosClient.get(`/api/chat/contacts`);
|
||||
console.log('Get contacts list response: ', response.data);
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch /api/chat/contacts: ', e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export async function sendContact(contact: string) {
|
||||
try {
|
||||
const response = await axiosClient.post(`/api/chat/contact/${contact}`);
|
||||
@@ -43,15 +32,3 @@ export async function getMessages(
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteContact(usernamecontact: string) {
|
||||
try {
|
||||
const response = await axiosClient.delete(
|
||||
`/api/chat/contacts/${usernamecontact}`,
|
||||
);
|
||||
console.log(response.data);
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
console.error('Failed to delete contact: ', e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ export default function Login() {
|
||||
setUser({ username: res.data.username, id: res.data.user_id });
|
||||
setAuthorized(true);
|
||||
setIsLoading(false);
|
||||
console.log('redirecting');
|
||||
navigate('/chat');
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user