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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user