Some checks failed
K8S Fission Deployment / Deployment fission functions (push) Failing after 23s
39 lines
765 B
Python
39 lines
765 B
Python
import io
|
|
|
|
from flask import Response
|
|
from helpers import S3_BUCKET, get_secret, s3_client
|
|
from PIL import Image
|
|
|
|
|
|
# Create&Update function to upload or update user avatar S3/Minio
|
|
def create_phone(user_id: str, file):
|
|
try:
|
|
|
|
|
|
return result, 200
|
|
|
|
except Exception as e:
|
|
return {"error": str(e)}, 500
|
|
|
|
|
|
def get_phone(user_id: str): # Read function to get user avatar from S3/Minio
|
|
try:
|
|
|
|
|
|
return Response(
|
|
|
|
), 200
|
|
|
|
except Exception as e:
|
|
return {"error": str(e)}, 500
|
|
|
|
|
|
# Delete Function to delete user avatar from S3/Minio
|
|
def delete_phone(user_id: str) -> dict:
|
|
try:
|
|
|
|
|
|
return result, 200
|
|
except Exception as e:
|
|
return {"error": str(e)}, 500
|