Skip to content

Commit

Permalink
fix endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jun 27, 2024
1 parent 169a178 commit e7b0de3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion agixt/MagicalAuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def update_user(self, **kwargs):
user_preference.pref_value = value
session.commit()
session.close()
return "User updated successfully"
return "User updated successfully."

def delete_user(self):
user = verify_api_key(self.token)
Expand Down
8 changes: 3 additions & 5 deletions agixt/endpoints/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ async def send_magic_link(request: Request, login: Login):
response_model=Detail,
summary="Update user details",
)
def update_user(update: UserInfo, request: Request, authorization: str = Header(None)):
response = request.json()
async def update_user(request: Request, authorization: str = Header(None)):
data = await request.json()
user = MagicalAuth(token=authorization).update_user(
ip_address=request.client.host,
**update.model_dump(),
**response,
ip_address=request.client.host, **data
)
return Detail(detail=user)

Expand Down

0 comments on commit e7b0de3

Please sign in to comment.