implement datatable sorting on non-analytics tables. (website/board/link/pixel/team/admin)

This commit is contained in:
Francis Cao committed 2026-05-07 10:46:03 -07:00
1 parent b5c4dbfa56
commit 5ccfb6d0a5
39 files changed
+322 -100

No files matched your search

+2 -1
View File
@@ -1,12 +1,13 @@
import { z } from 'zod';
import { parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { pagingParams } from '@/lib/schema';
import { pagingParams, sortingParams } from '@/lib/schema';
import { getUserTeams } from '@/queries/prisma';
export async function GET(request: Request, { params }: { params: Promise<{ userId: string }> }) {
const schema = z.object({
...pagingParams,
...sortingParams,
});
const { auth, query, error } = await parseRequest(request, schema);
+2 -1
View File
@@ -1,13 +1,14 @@
import { z } from 'zod';
import { getQueryFilters, parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { pagingParams, searchParams } from '@/lib/schema';
import { pagingParams, searchParams, sortingParams } from '@/lib/schema';
import { getAllUserWebsitesIncludingTeamAccess, getUserWebsites } from '@/queries/prisma/website';
export async function GET(request: Request, { params }: { params: Promise<{ userId: string }> }) {
const schema = z.object({
...pagingParams,
...searchParams,
...sortingParams,
includeTeams: z.string().optional(),
});