Skip to content

Commit

Permalink
fix(chrome extension): bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MorvanZhou committed Aug 23, 2024
1 parent c5457d5 commit 540427f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/retk/const/user_behavior_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ class UserBehaviorTypeEnum(IntEnum):
# node ops, backend
NODE_CREATE = 2
NODE_QUICK_CREATE = 3
NODE_BROWSER_EXTENSION_CREATE = 15

NODE_TRASHED_OPS = 4
NODE_RESTORED_OPS = 5
NODE_DELETED_OPS = 6
EXTENDED_NODE_ACCEPTED = 14

# search, backend
SEARCH_GLOBAL = 7
Expand All @@ -25,6 +24,9 @@ class UserBehaviorTypeEnum(IntEnum):
VIEW_NODE_FROM_LINKED_NODE = 12
VIEW_EXTENDED_NODE = 13

EXTENDED_NODE_ACCEPTED = 14 # backend
NODE_BROWSER_EXTENSION_CREATE = 15 # backend


USER_BEHAVIOR_TYPE_MAP = {
t.value: t
Expand Down
6 changes: 2 additions & 4 deletions src/retk/routes/browser_extension.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional
from typing import List

from fastapi import APIRouter, Form, UploadFile
from typing_extensions import Annotated
Expand Down Expand Up @@ -51,10 +51,8 @@ async def post_node_from_browser_extension(
content: Annotated[str, Form(...)],
referer: Annotated[str, Form(...)],
user_agent: Annotated[str, Form(alias="userAgent")],
images: Optional[List[Annotated[UploadFile, Form(...)]]] = None,
images: List[Annotated[UploadFile, Form(...)]],
) -> schemas.node.NodeResponse:
if images is None:
images = []
return await browser_extension.post_node(
au=au,
url=url,
Expand Down

0 comments on commit 540427f

Please sign in to comment.