MCPcopy Index your code
hub / github.com/simstudioai/sim / buildCursorCondition

Function buildCursorCondition

apps/sim/app/api/v1/audit-logs/query.ts:129–140  ·  view source on GitHub ↗
(cursor: string)

Source from the content-addressed store, hash-verified

127}
128
129function buildCursorCondition(cursor: string): SQL<unknown> | null {
130 const cursorData = decodeCursor(cursor)
131 if (!cursorData?.createdAt || !cursorData.id) return null
132
133 const cursorDate = new Date(cursorData.createdAt)
134 if (Number.isNaN(cursorDate.getTime())) return null
135
136 return or(
137 lt(auditLog.createdAt, cursorDate),
138 and(eq(auditLog.createdAt, cursorDate), lt(auditLog.id, cursorData.id))
139 )!
140}
141
142interface CursorPaginatedResult {
143 data: DbAuditLog[]

Callers 1

queryAuditLogsFunction · 0.70

Calls 2

decodeCursorFunction · 0.70
eqFunction · 0.50

Tested by

no test coverage detected