示例#1
0
def delete(id: str, user_service: UserService, auth_service: AuthService):
    try:
        auth = auth_service.validate(request.headers["Authorization"])
        if not auth:
            return jsonify({"message": "Not authorized"}), 401

        user = user_service.delete(id)
        return jsonify({"user": UserVo(user).to_dict()}), 200
    except Exception as e:
        logger.error(e)
        return jsonify({'message': 'Failed ...'}), 500
示例#2
0
 def delete(user_id):
     UserService.delete(user_id)
     return Response()
 def delete(user_id):
     UserService.delete(user_id)
     return Response(status=204)