Skip to content

Commit 7a9df9c

Browse files
committed
fix: undeletable OpenRouter models
1 parent 4e477e2 commit 7a9df9c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/actions/openrouter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ export async function addModel(name: string) {
6767
return newModel;
6868
}
6969

70-
export async function deleteModel(name: string) {
70+
export async function deleteModel(id: string) {
7171
const { claims } = await getLogtoContext(logtoConfig);
7272

7373
if (!claims) {
7474
throw new Error("User not authenticated");
7575
}
7676

77-
const existingModel = await prisma.customProvider.findFirst({
78-
where: { name, userId: claims.sub, type: "openrouter" },
77+
const existingModel = await prisma.customProvider.findUnique({
78+
where: { id },
7979
});
8080

8181
if (!existingModel) {

0 commit comments

Comments
 (0)