Skip to content

Commit b537f92

Browse files
committed
ran lint
1 parent 2f08f6e commit b537f92

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

apps/sim/app/api/v1/admin/audit-logs/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ export const GET = withAdminAuth(async (request) => {
5050
const startDateFilter = url.searchParams.get('startDate')
5151
const endDateFilter = url.searchParams.get('endDate')
5252

53-
if (startDateFilter && isNaN(Date.parse(startDateFilter))) {
53+
if (startDateFilter && Number.isNaN(Date.parse(startDateFilter))) {
5454
return badRequestResponse('Invalid startDate format. Use ISO 8601.')
5555
}
56-
if (endDateFilter && isNaN(Date.parse(endDateFilter))) {
56+
if (endDateFilter && Number.isNaN(Date.parse(endDateFilter))) {
5757
return badRequestResponse('Invalid endDate format. Use ISO 8601.')
5858
}
5959

apps/sim/app/api/v1/audit-logs/[id]/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ const logger = createLogger('V1AuditLogDetailAPI')
2424

2525
export const revalidate = 0
2626

27-
export async function GET(
28-
request: NextRequest,
29-
{ params }: { params: Promise<{ id: string }> }
30-
) {
27+
export async function GET(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
3128
const requestId = crypto.randomUUID().slice(0, 8)
3229

3330
try {

apps/sim/app/api/v1/audit-logs/auth.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ export async function validateEnterpriseAuditAccess(userId: string): Promise<Aut
4343
if (!membership) {
4444
return {
4545
success: false,
46-
response: NextResponse.json(
47-
{ error: 'Not a member of any organization' },
48-
{ status: 403 }
49-
),
46+
response: NextResponse.json({ error: 'Not a member of any organization' }, { status: 403 }),
5047
}
5148
}
5249

apps/sim/app/api/v1/audit-logs/route.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const logger = createLogger('V1AuditLogsAPI')
3535
export const dynamic = 'force-dynamic'
3636
export 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

Comments
 (0)