summaryrefslogtreecommitdiff
path: root/lib/tbe-last/service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tbe-last/service.ts')
-rw-r--r--lib/tbe-last/service.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/tbe-last/service.ts b/lib/tbe-last/service.ts
index b69ab71c..da0a5a4c 100644
--- a/lib/tbe-last/service.ts
+++ b/lib/tbe-last/service.ts
@@ -6,7 +6,7 @@ import db from "@/db/db";
import { and, desc, asc, eq, sql, or, isNull, isNotNull, ne, inArray } from "drizzle-orm";
import { tbeLastView, tbeDocumentsView } from "@/db/schema";
import { rfqPrItems } from "@/db/schema/rfqLast";
-import { rfqLastTbeDocumentReviews, rfqLastTbePdftronComments, rfqLastTbeVendorDocuments,rfqLastTbeSessions } from "@/db/schema";
+import {rfqLastDetails, rfqLastTbeDocumentReviews, rfqLastTbePdftronComments, rfqLastTbeVendorDocuments,rfqLastTbeSessions } from "@/db/schema";
import { filterColumns } from "@/lib/filter-columns";
import { GetTBELastSchema } from "./validations";
import { getServerSession } from "next-auth"
@@ -49,7 +49,11 @@ export async function getAllTBELast(input: GetTBELastSchema) {
}
// 최종 WHERE
- const finalWhere = and(advancedWhere, globalWhere, ne(tbeLastView.status,"생성중"));
+ const whereConditions = [advancedWhere, ne(tbeLastView.sessionStatus,"생성중")];
+ if (globalWhere) {
+ whereConditions.push(globalWhere);
+ }
+ const finalWhere = and(...whereConditions);
// 정렬
const orderBy = input.sort?.length