def saveuserinfo(): try: return Users.add_userinfo() except Exception as e: raise InvalidUsage(str(e), status_code=500)
def updateuserinfo(authid): try: return Users.update_userinfo(authid) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def removeuser(authid): try: return Auths.delete_account(authid) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def getallusers(): try: return Users.get_all_users() except Exception as e: raise InvalidUsage(str(e), status_code=500)
def getuserby(value): try: return Users.get_user_by(value) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def register(): try: return Auths.register() except Exception as e: raise InvalidUsage(str(e), status_code=500)
def confirm(token): try: return Auths.confirms(token) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def get_file(path, filename): try: return send_from_directory(app.config['UPLOAD_FOLDER'] + '/' + path, filename) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def login(): try: return Auths.login() except Exception as e: raise InvalidUsage(str(e), status_code=500)
def upload_file(path): try: return Files.uploadProfileImage(path) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def get_folder(path): try: return Files.getAllFiles(path) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def getallSubscribersRoute(): try: return Newsletter.getAllSubscribers() except Exception as e: raise InvalidUsage(str(e), status_code=500)
def unsubscribeProvider(value): try: return Newsletter.unsubscribe(value) except Exception as e: raise InvalidUsage(str(e), status_code=500)
def addSubscriber(): try: return Newsletter.subscribe_user() except Exception as e: raise InvalidUsage(str(e), status_code=500)