def put(self, id): data = request.get_json() user = UserModel.find_by_id(id) user.username = data["username"] user.password = data["password"] db.session.add(user) db.session.commit() return user.json()
def delete(self, id): user = UserModel.find_by_id(id) db.session.delete(user) db.session.commit() return user.json()
def get(self, id): user = UserModel.find_by_id(id) return user.json()