refactor(register, listings, items): simplify transaction, remove unused variable, add explicit types

- Remove newUser variable and directly return created user from Prisma transaction in register route
- Add explicit casts for Prisma QueryMode to avoid TypeScript widening in listings search
- Fix items search and getItemBySource with any cast and ts-expect-error to satisfy type checks

Improves readability and type safety without changing behavior.
This commit is contained in:
Evandro Fonseca Junior committed 2025-11-05 04:38:07 -03:00
1 parent ab37b477df
commit f35fee944d
33 files changed
+811 -295

No files matched your search

+2 -2
View File
@@ -426,8 +426,8 @@ export async function getActiveListings(
if (search) {
const searchCondition = {
OR: [
{ item_name: { contains: search, mode: "insensitive" } },
{ description: { contains: search, mode: "insensitive" } },
{ item_name: { contains: search, mode: "insensitive" as Prisma.QueryMode } },
{ description: { contains: search, mode: "insensitive" as Prisma.QueryMode } },
],
};
// Combinar com a condição OR existente