From 54d919dc2db0418730267496bf830fb24d5354e9 Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Wed, 26 Nov 2025 15:27:19 +0000 Subject: [PATCH] Fix how public lists are managed by correcting API request parameters Corrected the order of parameters in multiple `apiRequest` calls within `PublicLists.tsx` from `(url, { method, body })` to `(method, url, data)` to align with the function's expected signature. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 794d2db9-c8c8-4022-bb8d-1eb6a6ba7618 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/yTHq1Iw --- .replit | 4 ++++ client/src/pages/PublicLists.tsx | 18 ++++-------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.replit b/.replit index aa41490..6f531b0 100644 --- a/.replit +++ b/.replit @@ -14,6 +14,10 @@ run = ["npm", "run", "start"] localPort = 5000 externalPort = 80 +[[ports]] +localPort = 40145 +externalPort = 4200 + [[ports]] localPort = 41303 externalPort = 3002 diff --git a/client/src/pages/PublicLists.tsx b/client/src/pages/PublicLists.tsx index d42704d..5f2316e 100644 --- a/client/src/pages/PublicLists.tsx +++ b/client/src/pages/PublicLists.tsx @@ -52,10 +52,7 @@ export default function PublicLists() { const createMutation = useMutation({ mutationFn: (data: ListFormValues) => - apiRequest("/api/public-lists", { - method: "POST", - body: JSON.stringify(data), - }), + apiRequest("POST", "/api/public-lists", data), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["/api/public-lists"] }); toast({ @@ -76,10 +73,7 @@ export default function PublicLists() { const updateMutation = useMutation({ mutationFn: ({ id, data }: { id: string; data: Partial }) => - apiRequest(`/api/public-lists/${id}`, { - method: "PATCH", - body: JSON.stringify(data), - }), + apiRequest("PATCH", `/api/public-lists/${id}`, data), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["/api/public-lists"] }); toast({ @@ -92,9 +86,7 @@ export default function PublicLists() { const deleteMutation = useMutation({ mutationFn: (id: string) => - apiRequest(`/api/public-lists/${id}`, { - method: "DELETE", - }), + apiRequest("DELETE", `/api/public-lists/${id}`), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["/api/public-lists"] }); toast({ @@ -113,9 +105,7 @@ export default function PublicLists() { const syncMutation = useMutation({ mutationFn: (id: string) => - apiRequest(`/api/public-lists/${id}/sync`, { - method: "POST", - }), + apiRequest("POST", `/api/public-lists/${id}/sync`), onSuccess: () => { toast({ title: "Sync avviato",