Compare commits
No commits in common. "f878fe314dd903a471c423c22b6aa37cee439631" and "6d1072cc43d52da9b21d4d7f480afbe408f42eae" have entirely different histories.
f878fe314d
...
6d1072cc43
|
|
@ -3,7 +3,6 @@ import { getMessages } from '@controllers/MessageController';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { toastError } from '@controllers/Toasts';
|
import { toastError } from '@controllers/Toasts';
|
||||||
import ScrollToBottom from './ScrollToBottom';
|
import ScrollToBottom from './ScrollToBottom';
|
||||||
import { api } from '../main';
|
|
||||||
|
|
||||||
const MessageWrapper = () => {
|
const MessageWrapper = () => {
|
||||||
const {
|
const {
|
||||||
|
|
@ -11,14 +10,6 @@ const MessageWrapper = () => {
|
||||||
isLoading,
|
isLoading,
|
||||||
isError,
|
isError,
|
||||||
} = useQuery(['messages'], getMessages, {
|
} = useQuery(['messages'], getMessages, {
|
||||||
onSuccess: (data) => {
|
|
||||||
data.map((message: any) => {
|
|
||||||
if (message.image) {
|
|
||||||
message.image = api.slice(0, -4) + message.image;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
toastError(error as string);
|
toastError(error as string);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,9 @@ export const changeUserInfo = async (userId: string, formData: FormData) => {
|
||||||
newPassword,
|
newPassword,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
if (!response.ok) {
|
||||||
|
return {error: response.statusText};
|
||||||
|
}
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
return {error: data.error};
|
return {error: data.error};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue