rebrand ai-chatbot to openchat across app and api (#1418)

This commit is contained in:
dancer 2026-02-20 15:28:40 -08:00 committed by GitHub
parent 9d5d8a3ea7
commit f7b6b55a8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 90 additions and 90 deletions

View file

@ -1,7 +1,7 @@
import type { NextRequest } from "next/server";
import { auth } from "@/app/(auth)/auth";
import { deleteAllChatsByUserId, getChatsByUserId } from "@/lib/db/queries";
import { ChatSDKError } from "@/lib/errors";
import { OpenChatError } from "@/lib/errors";
export async function GET(request: NextRequest) {
const { searchParams } = request.nextUrl;
@ -11,7 +11,7 @@ export async function GET(request: NextRequest) {
const endingBefore = searchParams.get("ending_before");
if (startingAfter && endingBefore) {
return new ChatSDKError(
return new OpenChatError(
"bad_request:api",
"Only one of starting_after or ending_before can be provided."
).toResponse();
@ -20,7 +20,7 @@ export async function GET(request: NextRequest) {
const session = await auth();
if (!session?.user) {
return new ChatSDKError("unauthorized:chat").toResponse();
return new OpenChatError("unauthorized:chat").toResponse();
}
const chats = await getChatsByUserId({
@ -37,7 +37,7 @@ export async function DELETE() {
const session = await auth();
if (!session?.user) {
return new ChatSDKError("unauthorized:chat").toResponse();
return new OpenChatError("unauthorized:chat").toResponse();
}
const result = await deleteAllChatsByUserId({ userId: session.user.id });