diff options
Diffstat (limited to 'lib/sedp')
| -rw-r--r-- | lib/sedp/get-form-tags.ts | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/sedp/get-form-tags.ts b/lib/sedp/get-form-tags.ts index f307d54a..d37b1890 100644 --- a/lib/sedp/get-form-tags.ts +++ b/lib/sedp/get-form-tags.ts @@ -13,7 +13,7 @@ import { } from "@/db/schema"; import { eq, and, like, inArray } from "drizzle-orm"; import { getSEDPToken } from "./sedp-token"; -import { getFormMappingsByTagType } from "../tags/form-mapping-service"; +import { getFormMappingsByTagTypebyProeject } from "../tags/form-mapping-service"; interface Attribute { @@ -153,17 +153,15 @@ export async function importTagsFromSEDP( } // 태그 타입에 따른 폼 정보 가져오기 - const allFormMappings = await getFormMappingsByTagType( - tagTypeDescription, + const allFormMappings = await getFormMappingsByTagTypebyProeject( projectId, - tagClassLabel ); // ep가 "IMEP"인 것만 필터링 - const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || []; + // const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || []; // 현재 formCode와 일치하는 매핑 찾기 - const targetFormMapping = formMappings.find(mapping => mapping.formCode === formCode); + const targetFormMapping = allFormMappings.find(mapping => mapping.formCode === formCode); if (targetFormMapping) { console.log(`[IMPORT TAGS] Found IMEP form mapping for ${formCode}, creating form...`); @@ -246,17 +244,15 @@ export async function importTagsFromSEDP( } // form mapping 정보 가져오기 - const allFormMappings = await getFormMappingsByTagType( - tagTypeDescription, + const allFormMappings = await getFormMappingsByTagTypebyProeject( projectId, - tagClassLabel ); // ep가 "IMEP"인 것만 필터링 - const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || []; + // const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || []; // 현재 formCode와 일치하는 매핑 찾기 - const targetFormMapping = formMappings.find(mapping => mapping.formCode === formCode); + const targetFormMapping = allFormMappings.find(mapping => mapping.formCode === formCode); if (targetFormMapping) { targetImValue = targetFormMapping.ep === "IMEP"; |
