feat(vocab): restore manual hard vocabulary removal

This commit is contained in:
Torsten Schulz (local)
2026-08-27 10:42:01 +02:00
parent 0f8142c386
commit 9d0164aa0d
2 changed files with 28 additions and 2 deletions

View File

@@ -46,6 +46,13 @@
<strong>{{ entry.learning }}</strong>
<span>{{ entry.reference }}</span>
</div>
<button
type="button"
class="button-secondary course-hard-list__remove"
@click="unmarkHardVocab(entry)"
>
{{ $t('socialnetwork.vocab.courses.unmarkVocabHard') }}
</button>
</div>
</div>
</section>
@@ -606,6 +613,21 @@ export default {
this.hardVocabList = [];
}
},
async unmarkHardVocab(entry) {
const itemKey = String(entry?.itemKey || entry?.key || '').trim();
if (!itemKey || !this.courseId) return;
try {
await apiClient.patch('/api/vocab/srs/hard', {
courseId: this.courseId,
itemKey
});
this.hardVocabList = this.hardVocabList
.filter((item) => String(item?.itemKey || item?.key || '').trim() !== itemKey);
} catch (error) {
console.warn('Konnte die Hart-Markierung nicht entfernen:', error);
await this.refreshHardVocabList();
}
},
handleWindowFocus() {
this.refreshHardVocabList();
this.syncSrsSessionProgress();