Skip to content

Commit

Permalink
fix(api): Return 201 from highlights creation and fix docs for PATCH …
Browse files Browse the repository at this point in the history
…/lists/[listId]
  • Loading branch information
MohamedBassem committed Dec 30, 2024
1 parent 5d8d2de commit 5aee340
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apps/web/app/api/v1/highlights/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export const POST = (req: NextRequest) =>
bodySchema: zNewHighlightSchema,
handler: async ({ body, api }) => {
const resp = await api.highlights.create(body!);
return { status: 200, resp };
return { status: 201, resp };
},
});
4 changes: 1 addition & 3 deletions packages/open-api/hoarder-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,7 @@
"description": "No content - the bookmark was deleted"
}
}
}
},
"/list/{listId}": {
},
"patch": {
"description": "Update list by its id",
"summary": "Update a list",
Expand Down
2 changes: 1 addition & 1 deletion packages/open-api/lib/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ registry.registerPath({

registry.registerPath({
method: "patch",
path: "/list/{listId}",
path: "/lists/{listId}",
description: "Update list by its id",
summary: "Update a list",
tags: ["Lists"],
Expand Down
16 changes: 0 additions & 16 deletions packages/sdk/src/hoarder-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,22 +483,6 @@ export interface paths {
};
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/list/{listId}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
/**
* Update a list
* @description Update list by its id
Expand Down

0 comments on commit 5aee340

Please sign in to comment.