style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -1,12 +1,11 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { secureLogger } from "@/lib/secure-logger";
|
||||
import { type NextRequest, NextResponse } from "next/server";
|
||||
import { requireAuth } from "@/lib/auth/middleware";
|
||||
import {
|
||||
getUserNotifications,
|
||||
getUnreadCount,
|
||||
markAsRead,
|
||||
getUserNotifications,
|
||||
markAllAsRead,
|
||||
} from "@/lib/prisma/queries/notifications";
|
||||
import { secureLogger } from "@/lib/secure-logger";
|
||||
|
||||
/**
|
||||
* GET /api/notifications
|
||||
@@ -25,7 +24,8 @@ export async function GET(request: NextRequest) {
|
||||
: 50;
|
||||
|
||||
const notifications = await getUserNotifications(auth.userId, {
|
||||
is_read: isRead === "true" ? true : isRead === "false" ? false : undefined,
|
||||
is_read:
|
||||
isRead === "true" ? true : isRead === "false" ? false : undefined,
|
||||
limit,
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function GET(request: NextRequest) {
|
||||
notifications,
|
||||
unread_count: unreadCount,
|
||||
},
|
||||
{ status: 200 }
|
||||
{ status: 200 },
|
||||
);
|
||||
} catch (error) {
|
||||
secureLogger.error("❌ Erro ao buscar notificações", {
|
||||
@@ -47,7 +47,7 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
return NextResponse.json(
|
||||
{ success: false, error: "Erro ao buscar notificações" },
|
||||
{ status: 500 }
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -73,13 +73,13 @@ export async function POST(request: NextRequest) {
|
||||
message: `${count} notificações marcadas como lidas`,
|
||||
count,
|
||||
},
|
||||
{ status: 200 }
|
||||
{ status: 200 },
|
||||
);
|
||||
}
|
||||
|
||||
return NextResponse.json(
|
||||
{ success: false, error: "Ação inválida" },
|
||||
{ status: 400 }
|
||||
{ status: 400 },
|
||||
);
|
||||
} catch (error) {
|
||||
secureLogger.error("❌ Erro ao marcar notificações como lidas", {
|
||||
@@ -88,8 +88,7 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
return NextResponse.json(
|
||||
{ success: false, error: "Erro ao marcar notificações como lidas" },
|
||||
{ status: 500 }
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user