Compare commits

..

No commits in common. "main" and "1.2" have entirely different histories.
main ... 1.2

2 changed files with 3 additions and 9 deletions

View File

@ -3,7 +3,6 @@ import { getMessages } from '@controllers/MessageController';
import { useQuery } from '@tanstack/react-query';
import { toastError } from '@controllers/Toasts';
import ScrollToBottom from './ScrollToBottom';
import { api } from '../main';
const MessageWrapper = () => {
const {
@ -11,14 +10,6 @@ const MessageWrapper = () => {
isLoading,
isError,
} = useQuery(['messages'], getMessages, {
onSuccess: (data) => {
data.map((message: any) => {
if (message.image) {
message.image = api.slice(0, -4) + message.image;
}
});
return data;
},
onError: (error) => {
toastError(error as string);
},

View File

@ -132,6 +132,9 @@ export const changeUserInfo = async (userId: string, formData: FormData) => {
newPassword,
}),
});
if (!response.ok) {
return {error: response.statusText};
}
const data = await response.json();
if (data.error) {
return {error: data.error};