diff --git a/app/main.py b/app/main.py index 0c69c26..b6c585d 100644 --- a/app/main.py +++ b/app/main.py @@ -40,9 +40,10 @@ app.mount("/static", StaticFiles(directory="app/static"), name="static") @app.post('/images', response_model=dict[str, str]) async def upload_images(file: UploadFile): name = generate_random_string() - with open(f'app/static/images/{name}.webp', 'wb+') as file_object: + image_url = f'app/static/images/{name}_avatar.png' + with open(image_url, 'wb+') as file_object: shutil.copyfileobj(file.file, file_object) - return {'name': name} + return {'image_url': image_url}