summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-09-29 09:35:48 +0000
committerjoonhoekim <26rote@gmail.com>2025-09-29 09:35:48 +0000
commitedd6289cb0f5ce8701b4fb3a6c7fbdf4a6f8f6a2 (patch)
treebfcd1911c1f62a9b794e99a6c51e3ec234bac3ca /lib
parent83a6b993a750686a137787d591acadebc8bea79a (diff)
(고건) 삭제된 이메일 템플릿이 목록에 보이지 않도록 수정
Diffstat (limited to 'lib')
-rw-r--r--lib/email-template/service.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/email-template/service.ts b/lib/email-template/service.ts
index c492410a..7c92b377 100644
--- a/lib/email-template/service.ts
+++ b/lib/email-template/service.ts
@@ -1,7 +1,7 @@
'use server';
import db from '@/db/db';
-import { eq, and, desc, sql, count, ilike, asc, or } from 'drizzle-orm';
+import { eq, and, desc, sql, count, ilike, asc, or, SQL } from 'drizzle-orm';
import handlebars from 'handlebars';
import i18next from 'i18next';
import resourcesToBackend from 'i18next-resources-to-backend';
@@ -255,7 +255,9 @@ export async function getTemplateList(input: GetEmailTemplateSchema) {
}
}
- const conditions = [];
+ const conditions: SQL[] = [];
+ conditions.push(eq(templateListView.isActive, true));
+
if (advancedWhere) conditions.push(advancedWhere);
if (globalWhere) conditions.push(globalWhere);
@@ -265,7 +267,7 @@ export async function getTemplateList(input: GetEmailTemplateSchema) {
}
// 아니면 ilike, inArray, gte 등으로 where 절 구성
- const where = finalWhere
+ const where = finalWhere;
// 정렬 조건 구성
let orderBy;