@@ -35,7 +35,7 @@ const logger = createLogger('V1AuditLogsAPI')
3535export const dynamic = 'force-dynamic'
3636export const revalidate = 0
3737
38- const isoDateString = z . string ( ) . refine ( ( val ) => ! isNaN ( Date . parse ( val ) ) , {
38+ const isoDateString = z . string ( ) . refine ( ( val ) => ! Number . isNaN ( Date . parse ( val ) ) , {
3939 message : 'Invalid date format. Use ISO 8601.' ,
4040} )
4141
@@ -145,16 +145,13 @@ export async function GET(request: NextRequest) {
145145
146146 if ( params . cursor ) {
147147 const cursorData = decodeCursor ( params . cursor )
148- if ( cursorData && cursorData . createdAt && cursorData . id ) {
148+ if ( cursorData ? .createdAt && cursorData . id ) {
149149 const cursorDate = new Date ( cursorData . createdAt )
150- if ( ! isNaN ( cursorDate . getTime ( ) ) ) {
150+ if ( ! Number . isNaN ( cursorDate . getTime ( ) ) ) {
151151 conditions . push (
152152 or (
153153 lt ( auditLog . createdAt , cursorDate ) ,
154- and (
155- eq ( auditLog . createdAt , cursorDate ) ,
156- lt ( auditLog . id , cursorData . id )
157- )
154+ and ( eq ( auditLog . createdAt , cursorDate ) , lt ( auditLog . id , cursorData . id ) )
158155 ) !
159156 )
160157 }
@@ -183,11 +180,7 @@ export async function GET(request: NextRequest) {
183180 const formattedLogs = data . map ( formatAuditLogEntry )
184181
185182 const limits = await getUserLimits ( userId )
186- const response = createApiResponse (
187- { data : formattedLogs , nextCursor } ,
188- limits ,
189- rateLimit
190- )
183+ const response = createApiResponse ( { data : formattedLogs , nextCursor } , limits , rateLimit )
191184
192185 return NextResponse . json ( response . body , { headers : response . headers } )
193186 } catch ( error : unknown ) {
0 commit comments