use supabase
Browse files- supabase_service.py +3 -2
supabase_service.py
CHANGED
@@ -30,13 +30,14 @@ async def upload_image_to_supabase(file_path: str, file_name: str) -> str:
|
|
30 |
# Upload the file to Supabase Storage
|
31 |
try:
|
32 |
res = supabase.storage.from_(BUCKET_NAME).upload(file_name, file_data)
|
33 |
-
print("Upload response:", res) # Debugging: Print the response
|
34 |
except Exception as e:
|
|
|
35 |
raise Exception(f"Failed to upload file: {e}")
|
36 |
|
37 |
# Get the public URL of the uploaded file
|
38 |
public_url = supabase.storage.from_(BUCKET_NAME).get_public_url(file_name)
|
39 |
-
print("Public URL:", public_url) # Debugging: Print the public URL
|
40 |
|
41 |
return public_url
|
42 |
|
|
|
30 |
# Upload the file to Supabase Storage
|
31 |
try:
|
32 |
res = supabase.storage.from_(BUCKET_NAME).upload(file_name, file_data)
|
33 |
+
# print("Upload response:", res) # Debugging: Print the response
|
34 |
except Exception as e:
|
35 |
+
print(f"Error uploading file: {e}")
|
36 |
raise Exception(f"Failed to upload file: {e}")
|
37 |
|
38 |
# Get the public URL of the uploaded file
|
39 |
public_url = supabase.storage.from_(BUCKET_NAME).get_public_url(file_name)
|
40 |
+
# print("Public URL:", public_url) # Debugging: Print the public URL
|
41 |
|
42 |
return public_url
|
43 |
|