Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-03-23 11:12:56 +07:00
parent e345d9ccce
commit ffd177718f
39 changed files with 5258 additions and 520 deletions
+30
View File
@@ -0,0 +1,30 @@
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
async function main() {
const isMissingFilter = true
const baseWhereOptions: any[] = [{}]
if (isMissingFilter) {
baseWhereOptions.push({
OR: [
{ authorName: { in: ["", "Chưa rõ"] } },
{ description: "" },
{ description: { in: ["Chưa có giới thiệu", "Không có giới thiệu", "chưa có giới thiệu", "không có", "chưa rõ", "đang cập nhật"] } }
],
})
}
const rows = await prisma.novel.findMany({
where: {
AND: baseWhereOptions,
},
select: { id: true },
orderBy: [{ updatedAt: "desc" }],
take: 25,
skip: 0,
})
console.log("Returned rows length:", rows.length)
}
main().finally(() => prisma.$disconnect())