Skip to content

Commit

Permalink
added modifications for debounce etc
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr.suwala committed Jun 21, 2024
1 parent 0660c92 commit f96ee09
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion froncik/components/FormWithPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function FormWithPreview({form, id, fields}: Props) {
className="mb-2"
>
<Card.Header>Podgląd</Card.Header>
<Images id={id} fields={fields}></Images>
<Images key={id} id={id} fields={fields}></Images>
</Card>
</Col>
</Row>
Expand Down
2 changes: 1 addition & 1 deletion froncik/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const myFetch = (
const API = {
templates: {
list(): Promise<Template[]> {
return myFetch(`${API_PATH}/templates`)
return myFetch(`${API_PATH}/templates?size=10000`)
.then((req) => req.json())
.then((data) => data._embedded.templates as Template[]);
},
Expand Down
4 changes: 2 additions & 2 deletions froncik/pages/template/print/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type QueryParams = {
};

type Props = {};
const debounceDelay = 400; //ms
const debounceDelay = 1000; //ms

export default function Print({}: Props) {
const router = useRouter();
Expand Down Expand Up @@ -49,5 +49,5 @@ export default function Print({}: Props) {
/>
);

return (!isNaN(id) && id) && <FormWithPreview form={form} id={id} fields={fields}/>;
return (!isNaN(id) && id) && <FormWithPreview key={id} form={form} id={id} fields={fields}/>;
}

0 comments on commit f96ee09

Please sign in to comment.