From b707b56ba1cf542ae8410a15f85a48fef90f8d7a Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Tue, 18 Nov 2025 13:34:31 -0300 Subject: [PATCH] fix: type pagination error metadata --- convex/reports.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/convex/reports.ts b/convex/reports.ts index 231974f..e7ef002 100644 --- a/convex/reports.ts +++ b/convex/reports.ts @@ -246,7 +246,13 @@ async function paginateTickets( typeof message === "string" && message.includes("InvalidCursor"); // Alguns erros de paginação vêm embrulhados em ConvexError com metadados. - const data = (error as any)?.data; + type PaginationErrorMetadata = { + paginationError?: string; + }; + type PaginationError = { + data?: PaginationErrorMetadata; + }; + const data = (error as PaginationError | null | undefined)?.data; const isPaginationInvalidCursor = data && typeof data === "object" && data.paginationError === "InvalidCursor";