mirror of
https://github.com/documenso/documenso.git
synced 2026-08-26 00:02:43 +10:00
fix(templates): use defaults for zero pagination values
This commit is contained in:
@@ -41,6 +41,8 @@ export default function TemplatesPage() {
|
||||
const [findTemplateSearchParams] = useQueryStates(templatesSearchParams, {
|
||||
history: 'push',
|
||||
});
|
||||
const page = findTemplateSearchParams.page || undefined;
|
||||
const perPage = findTemplateSearchParams.perPage || undefined;
|
||||
|
||||
const isOrgView = findTemplateSearchParams.view === 'organisation';
|
||||
const showOrgFilter = organisation.type !== OrganisationType.PERSONAL;
|
||||
@@ -62,8 +64,8 @@ export default function TemplatesPage() {
|
||||
|
||||
const teamTemplatesQuery = trpc.template.findTemplates.useQuery(
|
||||
{
|
||||
page: findTemplateSearchParams.page ?? undefined,
|
||||
perPage: findTemplateSearchParams.perPage ?? undefined,
|
||||
page,
|
||||
perPage,
|
||||
folderId,
|
||||
},
|
||||
{
|
||||
@@ -73,8 +75,8 @@ export default function TemplatesPage() {
|
||||
|
||||
const orgTemplatesQuery = trpc.template.findOrganisationTemplates.useQuery(
|
||||
{
|
||||
page: findTemplateSearchParams.page ?? undefined,
|
||||
perPage: findTemplateSearchParams.perPage ?? undefined,
|
||||
page,
|
||||
perPage,
|
||||
},
|
||||
{
|
||||
enabled: isOrgView,
|
||||
|
||||
Reference in New Issue
Block a user