D
This commit is contained in:
parent
b364af645f
commit
ecc67737c6
1 changed files with 6 additions and 4 deletions
|
@ -36,13 +36,15 @@ const Chat: React.FC<ChatInterface> = ({ chat, inputRef, className }) => {
|
||||||
|
|
||||||
const submitMessage = () => {
|
const submitMessage = () => {
|
||||||
createChatMessage.mutate({ chatId: chat.id, content }, {
|
createChatMessage.mutate({ chatId: chat.id, content }, {
|
||||||
onError: (_error, _variables, context: any) => {
|
|
||||||
setContent(context.prevContent as string);
|
|
||||||
setErrorSubmittingMessage(true);
|
|
||||||
},
|
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
setErrorSubmittingMessage(false);
|
setErrorSubmittingMessage(false);
|
||||||
},
|
},
|
||||||
|
onError: (error, _variables, context: any) => {
|
||||||
|
console.log(context);
|
||||||
|
|
||||||
|
setContent(context.prevContent as string);
|
||||||
|
setErrorSubmittingMessage(true);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
clearState();
|
clearState();
|
||||||
|
|
Loading…
Reference in a new issue