feat: add ability to share chats (#594)

This commit is contained in:
Jeremy 2024-12-06 13:36:56 +03:00 committed by GitHub
parent 64d1aad2bb
commit 4d901ba066
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 877 additions and 66 deletions

View file

@ -7,7 +7,9 @@ import { customModel } from '@/lib/ai';
import {
deleteMessagesByChatIdAfterTimestamp,
getMessageById,
updateChatVisiblityById,
} from '@/lib/db/queries';
import { VisibilityType } from '@/components/visibility-selector';
export async function saveModelId(model: string) {
const cookieStore = await cookies();
@ -40,3 +42,13 @@ export async function deleteTrailingMessages({ id }: { id: string }) {
timestamp: message.createdAt,
});
}
export async function updateChatVisibility({
chatId,
visibility,
}: {
chatId: string;
visibility: VisibilityType;
}) {
await updateChatVisiblityById({ chatId, visibility });
}