2023-09-14 12:56:59 +03:00
|
|
|
from multiprocessing import get_logger
|
|
|
|
|
|
|
|
from httpx import Response
|
|
|
|
from models import get_supabase_client
|
|
|
|
from supabase.client import Client
|
|
|
|
|
|
|
|
logger = get_logger()
|
|
|
|
|
|
|
|
|
|
|
|
def upload_file_storage(file, file_identifier: str) -> Response:
|
|
|
|
supabase_client: Client = get_supabase_client()
|
|
|
|
# res = supabase_client.storage.create_bucket("quivr")
|
|
|
|
response = None
|
|
|
|
|
|
|
|
try:
|
|
|
|
response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
|
|
|
|
return response
|
|
|
|
except Exception as e:
|
|
|
|
logger.error(e)
|
2023-09-14 17:46:39 +03:00
|
|
|
print(e)
|
2023-09-14 12:56:59 +03:00
|
|
|
return response
|