From f96ee09bb08aeaa2e95de8c71396aa6f161dd271 Mon Sep 17 00:00:00 2001 From: "piotr.suwala" Date: Fri, 21 Jun 2024 20:46:53 +0200 Subject: [PATCH] added modifications for debounce etc --- froncik/components/FormWithPreview.tsx | 2 +- froncik/lib/api.ts | 2 +- froncik/pages/template/print/[id].tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/froncik/components/FormWithPreview.tsx b/froncik/components/FormWithPreview.tsx index 110ff79..d273797 100644 --- a/froncik/components/FormWithPreview.tsx +++ b/froncik/components/FormWithPreview.tsx @@ -24,7 +24,7 @@ export default function FormWithPreview({form, id, fields}: Props) { className="mb-2" > PodglÄ…d - + diff --git a/froncik/lib/api.ts b/froncik/lib/api.ts index 4f91ee0..7fe1010 100644 --- a/froncik/lib/api.ts +++ b/froncik/lib/api.ts @@ -17,7 +17,7 @@ const myFetch = ( const API = { templates: { list(): Promise { - return myFetch(`${API_PATH}/templates`) + return myFetch(`${API_PATH}/templates?size=10000`) .then((req) => req.json()) .then((data) => data._embedded.templates as Template[]); }, diff --git a/froncik/pages/template/print/[id].tsx b/froncik/pages/template/print/[id].tsx index 7a24ead..53a53c8 100644 --- a/froncik/pages/template/print/[id].tsx +++ b/froncik/pages/template/print/[id].tsx @@ -12,7 +12,7 @@ type QueryParams = { }; type Props = {}; -const debounceDelay = 400; //ms +const debounceDelay = 1000; //ms export default function Print({}: Props) { const router = useRouter(); @@ -49,5 +49,5 @@ export default function Print({}: Props) { /> ); - return (!isNaN(id) && id) && ; + return (!isNaN(id) && id) && ; }