summaryrefslogtreecommitdiff
path: root/lib/projects/service.ts
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-09-30 19:50:09 +0900
committerjoonhoekim <26rote@gmail.com>2025-09-30 19:50:09 +0900
commitf02773ab37bd911b1f3a81a93a7d5aaffd04bcad (patch)
tree5714e9501586547d761db2086de3bb82fddf13db /lib/projects/service.ts
parent2c02afd48a4d9276a4f5c132e088540a578d0972 (diff)
(김준회) 스테이지 선택 로직 오류 수정 및 스크롤 처리
Diffstat (limited to 'lib/projects/service.ts')
-rw-r--r--lib/projects/service.ts15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/projects/service.ts b/lib/projects/service.ts
index 4685fce4..aad1856e 100644
--- a/lib/projects/service.ts
+++ b/lib/projects/service.ts
@@ -121,16 +121,13 @@ export async function getAllProjectInfoByProjectCode(projectCode: string) {
*/
export async function getProjectCode(projectId: number): Promise<string | null> {
try {
- const project = await db.project.findUnique({
- where: {
- id: projectId,
- },
- select: {
- code: true,
- },
- })
+ const project = await db
+ .select({ code: projects.code })
+ .from(projects)
+ .where(eq(projects.id, projectId))
+ .limit(1);
- return project?.code || null
+ return project[0]?.code || null;
} catch (error) {
console.error("Error fetching project code:", error)
return null