diff --git a/src/App.svelte b/src/App.svelte index 7e958b2..454ca3b 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -157,7 +157,6 @@ try { const response = await request.post>('/media/create', { ...media, - type: currentCategory }); if (response.data.code === 0) { @@ -176,7 +175,6 @@ try { const response = await request.put>(`/media/updateById/${media.id}`, { ...media, - type: currentCategory }); if (response.data.code === 0) { diff --git a/src/lib/MediaFormModal.svelte b/src/lib/MediaFormModal.svelte index 3de9305..9a064dc 100644 --- a/src/lib/MediaFormModal.svelte +++ b/src/lib/MediaFormModal.svelte @@ -33,7 +33,15 @@ { value: 'plan_to_watch', label: '计划中' }, { value: 'in_progress', label: '进行中' }, { value: 'completed', label: '已完成' } - ] as const; + ]; + + const typeOptions = [ + { value: 'game', label: '游戏' }, + { value: 'book', label: '书籍' }, + { value: 'movie', label: '电影' }, + { value: 'anime', label: '番剧' }, + { value: 'other', label: '其它' }, + ]; function handleSubmit(e: Event) { e.preventDefault(); @@ -85,6 +93,21 @@ /> +
+ + +
+
-
- + {#if media.type === 'game' || media.type === 'other'} +
+ + +
+ {/if}