refactor: remove unused user profile GET API route

This commit is contained in:
2026-02-28 12:15:54 +01:00
parent 70a77481e5
commit 9a11ab16bb
2 changed files with 1 additions and 30 deletions

View File

@@ -1,29 +0,0 @@
import { NextResponse } from "next/server";
import { UserService } from "@/lib/services/user.service";
import { AppError } from "@/utils/errors";
import logger from "@/lib/logger";
export async function GET() {
try {
const [profile, stats] = await Promise.all([
UserService.getUserProfile(),
UserService.getUserStats(),
]);
return NextResponse.json({ ...profile, stats });
} catch (error) {
logger.error({ err: error }, "Erreur lors de la récupération du profil:");
if (error instanceof AppError) {
return NextResponse.json(
{ error: error.message, code: error.code },
{ status: error.code === "AUTH_UNAUTHENTICATED" ? 401 : 500 }
);
}
return NextResponse.json(
{ error: "Erreur lors de la récupération du profil" },
{ status: 500 }
);
}
}