From 7e4e86ec5749eefb7c9d5fdc001d849d8425103d Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 20 Sep 2024 15:19:56 -0700 Subject: [PATCH] always add the upload endpoint --- reflex/app.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 84b7552c1..ed436c794 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -66,7 +66,7 @@ from reflex.components.core.client_side_routing import ( Default404Page, wait_for_client_redirect, ) -from reflex.components.core.upload import Upload, get_upload_dir +from reflex.components.core.upload import get_upload_dir from reflex.components.radix import themes from reflex.config import get_config from reflex.event import Event, EventHandler, EventSpec, window_alert @@ -404,15 +404,15 @@ class App(MiddlewareMixin, LifespanMixin, Base): def _add_optional_endpoints(self): """Add optional api endpoints (_upload).""" # To upload files. - if Upload.is_used: - self.api.post(str(constants.Endpoint.UPLOAD))(upload(self)) - # To access uploaded files. - self.api.mount( - str(constants.Endpoint.UPLOAD), - StaticFiles(directory=get_upload_dir()), - name="uploaded_files", - ) + self.api.post(str(constants.Endpoint.UPLOAD))(upload(self)) + + # To access uploaded files. + self.api.mount( + str(constants.Endpoint.UPLOAD), + StaticFiles(directory=get_upload_dir()), + name="uploaded_files", + ) if codespaces.is_running_in_codespaces(): self.api.get(str(constants.Endpoint.AUTH_CODESPACE))( codespaces.auth_codespace