mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
added description for api, changes in upload image and file to alibaba method
This commit is contained in:
@ -4,7 +4,7 @@ web_utils file
|
||||
import base64
|
||||
|
||||
from base.constants import ARTICLE_CARD_IMAGE_FOLDER
|
||||
from guardian.utils import upload_image_to_alibaba
|
||||
from guardian.utils import upload_image_to_alibaba, upload_base64_image_to_alibaba
|
||||
|
||||
|
||||
def pop_id(data):
|
||||
@ -32,7 +32,7 @@ def get_image_url(data):
|
||||
image_name = data.pop('image_name') if 'image_name' in data else f"{data['title']}.jpg"
|
||||
filename = f"{ARTICLE_CARD_IMAGE_FOLDER}/{image_name}"
|
||||
# upload image on ali baba
|
||||
image_url = upload_image_to_alibaba(base64_image, filename)
|
||||
image_url = upload_base64_image_to_alibaba(base64_image, filename)
|
||||
return image_url
|
||||
elif 'image' in data and data['image'] is not None:
|
||||
image = data.pop('image')
|
||||
|
||||
Reference in New Issue
Block a user