Explorar o código

add edit profile api and limit user_profile

ming %!s(int64=3) %!d(string=hai) anos
pai
achega
fe4614bd9f
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      api/main.py

+ 1 - 0
api/main.py

@@ -163,6 +163,7 @@ async def edit_profile(userModel : models.UserProfile ,token: str = Depends(oaut
     user_obj = next(iter(db.query('SELECT * FROM users where id ="'+str(user_id)+'"')))
     user_obj['email'] = userModel.email
     db['users'].update(dict(user_obj), ['id'])
+    db.query('UPDATE users SET email = "'+userModel.email+'" where id ='+str(user_id))
     return {'msg':'ok'}
 
 # login & register page