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";