fix: type pagination error metadata
This commit is contained in:
parent
2724746cb7
commit
b707b56ba1
1 changed files with 7 additions and 1 deletions
|
|
@ -246,7 +246,13 @@ async function paginateTickets<T>(
|
||||||
typeof message === "string" &&
|
typeof message === "string" &&
|
||||||
message.includes("InvalidCursor");
|
message.includes("InvalidCursor");
|
||||||
// Alguns erros de paginação vêm embrulhados em ConvexError com metadados.
|
// 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 =
|
const isPaginationInvalidCursor =
|
||||||
data && typeof data === "object" && data.paginationError === "InvalidCursor";
|
data && typeof data === "object" && data.paginationError === "InvalidCursor";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue