aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/open-api/karakeep-openapi-spec.json22
-rw-r--r--packages/open-api/lib/lists.ts8
-rw-r--r--packages/trpc/models/lists.ts6
3 files changed, 2 insertions, 34 deletions
diff --git a/packages/open-api/karakeep-openapi-spec.json b/packages/open-api/karakeep-openapi-spec.json
index 0f8074d4..3bdaed54 100644
--- a/packages/open-api/karakeep-openapi-spec.json
+++ b/packages/open-api/karakeep-openapi-spec.json
@@ -2071,28 +2071,6 @@
"204": {
"description": "No content - the bookmark was added"
},
- "400": {
- "description": "Bookmark already in list",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string"
- },
- "message": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "message"
- ]
- }
- }
- }
- },
"404": {
"description": "List or bookmark not found",
"content": {
diff --git a/packages/open-api/lib/lists.ts b/packages/open-api/lib/lists.ts
index 2273d33b..ab07e425 100644
--- a/packages/open-api/lib/lists.ts
+++ b/packages/open-api/lib/lists.ts
@@ -232,14 +232,6 @@ registry.registerPath({
204: {
description: "No content - the bookmark was added",
},
- 400: {
- description: "Bookmark already in list",
- content: {
- "application/json": {
- schema: ErrorSchema,
- },
- },
- },
404: {
description: "List or bookmark not found",
content: {
diff --git a/packages/trpc/models/lists.ts b/packages/trpc/models/lists.ts
index 4da127d2..21b23593 100644
--- a/packages/trpc/models/lists.ts
+++ b/packages/trpc/models/lists.ts
@@ -260,10 +260,8 @@ export class ManualList extends List {
} catch (e) {
if (e instanceof SqliteError) {
if (e.code == "SQLITE_CONSTRAINT_PRIMARYKEY") {
- throw new TRPCError({
- code: "BAD_REQUEST",
- message: `Bookmark ${bookmarkId} is already in the list ${this.list.id}`,
- });
+ // this is fine, it just means the bookmark is already in the list
+ return;
}
}
throw new TRPCError({