Skip to content

Commit 164e6c4

Browse files
SeaSide53SeaSide53
SeaSide53
authored and
SeaSide53
committed
Fix: List updating
1 parent 2e5d285 commit 164e6c4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/list/[id]/index.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const ListPage: NextPage<PageProps> = ({ data }) => {
171171
}
172172
};
173173

174-
const submitHandle: FormEventHandler = useCallback(
174+
const editHandle: FormEventHandler = useCallback(
175175
(e) => {
176176
(async () => {
177177
e.preventDefault();
@@ -182,7 +182,11 @@ const ListPage: NextPage<PageProps> = ({ data }) => {
182182
const res = await fetch(`/api/list/${encodeURIComponent(data.id)}/update`, {
183183
method: "POST",
184184
body: JSON.stringify({
185-
...data,
185+
title: data.title,
186+
description: data.description,
187+
gameVersion: data.gameVersion,
188+
modloader: data.modloader,
189+
visibility: data.visibility,
186190
mods: resolvedMods.map((elem) => richModToMod(elem)),
187191
}),
188192
headers: { "Content-Type": "application/json" },
@@ -610,7 +614,7 @@ ${
610614
{hasElevatedPermissions && (
611615
<div className="mb-16 flex flex-wrap items-center gap-2">
612616
{isEditing ? (
613-
<Button variant="green" onClick={submitHandle} disabled={isSaving}>
617+
<Button variant="green" onClick={editHandle} disabled={isSaving}>
614618
{isSaving ? <Spinner className="block h-5 w-5" /> : <SaveIcon className="block h-5 w-5" />}
615619
<span>Save</span>
616620
</Button>

0 commit comments

Comments
 (0)