fix(study): 검수함 each_key_duplicate 크래시 — 자료(수동) 그룹 null 키 중복 해소
manual 카드 그룹은 source_question_id=null 이라 자료가 2개+ 면 {#each ... (g.source_question_id)} 키 중복 → Svelte each_key_duplicate 크래시. 키를 (source_question_id ?? question_text) 고유값으로 변경. 추가로 자료 그룹은 approve-batch 가 source_question_id:int 필수라 422 → 일괄승인 버튼을 question 그룹에만 노출. 개별 승인/수정/삭제는 cardId 기반이라 자료도 정상.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -152,7 +152,7 @@
|
||||
<EmptyState title="검수할 카드가 없습니다" description="새 문제를 풀면 AI가 암기카드를 추출해 여기에 쌓입니다." icon={CheckCheck} />
|
||||
{:else}
|
||||
<div class="space-y-5">
|
||||
{#each shownGroups as g (g.source_question_id)}
|
||||
{#each shownGroups as g (g.source_question_id ?? g.question_text)}
|
||||
<div class="rounded-card border border-default bg-bg/40 p-3">
|
||||
<!-- 출처 문제 -->
|
||||
<div class="mb-3 flex items-start gap-2 rounded-lg border border-default bg-surface px-3 py-2">
|
||||
@@ -162,7 +162,7 @@
|
||||
<div class="text-sm text-text">{g.question_text}</div>
|
||||
{#if g.correct_choice}<div class="mt-0.5 text-xs text-accent">사용자 정답: {g.correct_choice}번</div>{/if}
|
||||
</div>
|
||||
{#if g.cards.length > 1}
|
||||
{#if g.cards.length > 1 && g.source_question_id != null}
|
||||
<Button variant="secondary" size="sm" icon={CheckCheck} onclick={() => approveGroup(g.source_question_id, g.cards.length)}>{g.cards.length}장 승인</Button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user