Skip to content

The Open Source DocuSign Alternative.

571 B
Raw Blame
import { parseAsArrayOf, parseAsInteger, parseAsString, parseAsStringLiteral } from 'nuqs';

export const TEMPLATES_VIEW_VALUES = ['team', 'organisation'] as const;

/**
 * Shared nuqs parsers for the templates page URL state.
 *
 * Used by the templates page and its filter components so every consumer
 * parses and serialises the params identically.
 */
export const templatesSearchParams = {
  view: parseAsStringLiteral(TEMPLATES_VIEW_VALUES),
  ownerIds: parseAsArrayOf(parseAsInteger),
  page: parseAsInteger,
  perPage: parseAsInteger,
  query: parseAsString,
};