Refactor avatar upload logic: Update API routes to create a dedicated 'uploads/avatars' directory for storing user avatars, ensuring organized file management and returning the correct image URL.

This commit is contained in:
Julien Froidefond
2025-12-12 15:51:47 +01:00
parent aada4ad08b
commit 702476c349
4 changed files with 83 additions and 11 deletions

View File

@@ -349,7 +349,7 @@ export default function UserManagement() {
formData.append("file", file);
const response = await fetch(
"/api/admin/images/upload",
"/api/admin/avatars/upload",
{
method: "POST",
body: formData,