Skip to content

Commit

Permalink
chat history
Browse files Browse the repository at this point in the history
  • Loading branch information
yaojin3616 committed Jan 17, 2024
1 parent b2bddb3 commit 400856c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backend/bisheng/api/v1/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_chatmessage(*,
ChatMessage.chat_id == chat_id,
ChatMessage.user_id == payload.get('user_id'))
if id:
where = where.where(ChatMessage.id < id)
where = where.where(ChatMessage.id < int(id))
db_message = session.exec(where.order_by(ChatMessage.id.desc()).limit(page_size)).all()
return resp_200(db_message)

Expand Down
2 changes: 1 addition & 1 deletion src/backend/bisheng/api/v1/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ async def regist(*, session: Session = Depends(get_session), user: UserCreate):
# check if admin user
admin = session.exec(select(User).where(User.user_id == 1)).all()
if not admin:
db_user_role = UserRole(user_id=db_user.user_id, role_id=1)
db_user.user_id = 1
db_user_role = UserRole(user_id=db_user.user_id, role_id=1)
session.add(db_user_role)

# check if user already exist
Expand Down

0 comments on commit 400856c

Please sign in to comment.