1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-25 00:21:28 +02:00

Fix, delete chat throwing error

This commit is contained in:
Kamran Ahmed
2025-06-12 16:59:01 +01:00
parent 70f2c582f3
commit 198e0387b9
2 changed files with 11 additions and 2 deletions

View File

@@ -101,11 +101,20 @@ export function AIChat(props: AIChatProps) {
useMutation(
{
mutationFn: (messages: RoadmapAIChatHistoryType[]) => {
if (!defaultChatHistoryId) {
return Promise.resolve({
status: 200,
message: 'Chat history not found',
});
}
return httpPost(`/v1-delete-chat-message/${defaultChatHistoryId}`, {
messages,
});
},
onSuccess: () => {
textareaMessageRef.current?.focus();
queryClient.invalidateQueries(
chatHistoryOptions(defaultChatHistoryId),
);

View File

@@ -229,7 +229,7 @@ export function UpgradeToProMessage(props: UpgradeToProMessageProps) {
{closeButton}
</div>
<div className="flex grow flex-col items-center justify-center px-2">
<div className="flex grow flex-col items-center justify-center px-4">
<div className="flex flex-col items-center">
<div className="mb-3 rounded-full bg-yellow-100 p-3">
<LockIcon className="size-6 text-yellow-600" />
@@ -242,7 +242,7 @@ export function UpgradeToProMessage(props: UpgradeToProMessageProps) {
</p>
</div>
<div className="w-full space-y-2 my-5">
<div className="my-5 w-full space-y-2">
<div className="flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2">
<CheckIcon additionalClasses="size-4 text-green-500" />
<span className="text-sm text-gray-600">Unlimited history</span>