Skip to content

Commit 3465c93

Browse files
committed
deal with some elint error
1 parent 053df33 commit 3465c93

File tree

7 files changed

+778
-3438
lines changed

7 files changed

+778
-3438
lines changed

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"next/core-web-vitals",
4+
"next/typescript"
5+
]
6+
}

app/api/crates/[name]/[version]/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function GET(req: NextRequest, { params }: { params: { name: string
5858
}
5959

6060
const versionInfo = versionRes.rows[0];
61-
const dependencies = dependenciesRes.rows.map((row: any) => ({
61+
const dependencies = dependenciesRes.rows.map((row) => ({
6262
name: row.dependency_name,
6363
version: row.dependency_version,
6464
}));

app/api/crates/[name]/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function GET(req: NextRequest, { params }: { params: { name: string
2727
[name]
2828
);
2929

30-
const versions = versionsRes.rows.map((row: any) => row.version);
30+
const versions = versionsRes.rows.map((row) => row.version);
3131

3232
client.release();
3333

app/api/crates/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextRequest, NextResponse } from 'next/server';
22

3-
export async function GET(req: NextRequest) {
3+
export async function GET() {
44
try {
55
// 发送 HTTP 请求获取外部数据
66
const externalApiUrl = 'http://210.28.134.203:6888/api/crates'; // 替换为你的外部 API URL

app/api/submit/route.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ export async function POST(request: Request) {
1111
method: 'POST',
1212
body: formData, // 保持 FormData
1313
});
14-
15-
if (!response.ok) {
16-
return NextResponse.json({ error: 'Failed to submit data' }, { status: response.status });
17-
}
18-
1914
const result = await response.json(); // 确认返回的是 JSON 格式
2015
return NextResponse.json({ message: 'Submission successful', data: result });
2116
} catch (error) {

0 commit comments

Comments
 (0)