코드 활성/비활성화 해결
This commit is contained in:
@@ -67,7 +67,7 @@ export function CodeDetailPanel({ categoryCode }: CodeDetailPanelProps) {
|
||||
})),
|
||||
});
|
||||
},
|
||||
getItemId: (code: CodeInfo) => code.code_value,
|
||||
getItemId: (code: CodeInfo) => code.codeValue || code.code_value,
|
||||
});
|
||||
|
||||
// 새 코드 생성
|
||||
@@ -95,7 +95,7 @@ export function CodeDetailPanel({ categoryCode }: CodeDetailPanelProps) {
|
||||
try {
|
||||
await deleteCodeMutation.mutateAsync({
|
||||
categoryCode,
|
||||
codeValue: deletingCode.code_value,
|
||||
codeValue: deletingCode.codeValue || deletingCode.code_value,
|
||||
});
|
||||
|
||||
setShowDeleteModal(false);
|
||||
@@ -182,13 +182,13 @@ export function CodeDetailPanel({ categoryCode }: CodeDetailPanelProps) {
|
||||
<div className="p-2">
|
||||
<DndContext {...dragAndDrop.dndContextProps}>
|
||||
<SortableContext
|
||||
items={filteredCodes.map((code) => code.code_value)}
|
||||
items={filteredCodes.map((code) => code.codeValue || code.code_value)}
|
||||
strategy={verticalListSortingStrategy}
|
||||
>
|
||||
<div className="space-y-1">
|
||||
{filteredCodes.map((code, index) => (
|
||||
<SortableCodeItem
|
||||
key={`${code.code_value}-${index}`}
|
||||
key={`${code.codeValue || code.code_value}-${index}`}
|
||||
code={code}
|
||||
categoryCode={categoryCode}
|
||||
onEdit={() => handleEditCode(code)}
|
||||
@@ -208,20 +208,28 @@ export function CodeDetailPanel({ categoryCode }: CodeDetailPanelProps) {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<h3 className="font-medium text-gray-900">{activeCode.code_name}</h3>
|
||||
<h3 className="font-medium text-gray-900">
|
||||
{activeCode.codeName || activeCode.code_name}
|
||||
</h3>
|
||||
<Badge
|
||||
variant={activeCode.is_active === "Y" ? "default" : "secondary"}
|
||||
variant={
|
||||
activeCode.isActive === "Y" || activeCode.is_active === "Y"
|
||||
? "default"
|
||||
: "secondary"
|
||||
}
|
||||
className={cn(
|
||||
"transition-colors",
|
||||
activeCode.is_active === "Y"
|
||||
activeCode.isActive === "Y" || activeCode.is_active === "Y"
|
||||
? "bg-green-100 text-green-800"
|
||||
: "bg-gray-100 text-gray-600",
|
||||
)}
|
||||
>
|
||||
{activeCode.is_active === "Y" ? "활성" : "비활성"}
|
||||
{activeCode.isActive === "Y" || activeCode.is_active === "Y" ? "활성" : "비활성"}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="mt-1 text-sm text-gray-600">{activeCode.code_value}</p>
|
||||
<p className="mt-1 text-sm text-gray-600">
|
||||
{activeCode.codeValue || activeCode.code_value}
|
||||
</p>
|
||||
{activeCode.description && (
|
||||
<p className="mt-1 text-sm text-gray-500">{activeCode.description}</p>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user