Skip to content

Commit

Permalink
🐛 fix: remove default type field from createBookmarkRequest (main)
Browse files Browse the repository at this point in the history
- Default value for 'type' in createBookmarkRequest struct has been removed to ensure explicit specification
- Resolved an issue in add-bookmark.tsx by adding 'type' field to the createBookmark function call.
  • Loading branch information
vaayne committed Feb 8, 2025
1 parent edefbf5 commit af44696
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/port/httpserver/handler_bookmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ type createBookmarkRequest struct {
Content string `json:"content,omitempty"`
HTML string `json:"html,omitempty"`

Type bookmarks.ContentType `json:"type" validate:"required,oneof=bookmark pdf epub image audio video" default:"bookmark"`
Type bookmarks.ContentType `json:"type" validate:"required,oneof=bookmark pdf epub image audio video"`
S3Key string `json:"s3_key,omitempty"`
Metadata *bookmarks.BookmarkContentMetadata `json:"metadata,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/bookmarks/add-bookmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function AddBookmarkModal() {
setIsLoading(true);
try {
if (activeTab === "url") {
await createBookmark({ url });
await createBookmark({ url: url, type: "bookmark" });
setUrl("");
} else {
console.log("start upload file");
Expand Down

0 comments on commit af44696

Please sign in to comment.