Skip to content

Commit 01cdf9c

Browse files
build issue fixes
1 parent 43370f2 commit 01cdf9c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/app/api/tasks/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Task, { ITask } from "@/models/Task";
33
import { NextResponse } from "next/server";
44

55
// To handle a GET request to /api
6-
export async function GET(request) {
6+
export async function GET() {
77
await connectToDatabase();
88
const tasks: ITask[] = await Task.find({});
99
return NextResponse.json(tasks, { status: 200 });

src/lib/mongodb.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ if (!MONGODB_URI) {
88
console.warn('database defined')
99
}
1010

11-
let cached = (global as any).mongoose || { conn: null, promise: null };
11+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
12+
const cached = (global as any).mongoose || { conn: null, promise: null };
1213

1314
async function connectToDatabase() {
1415
if (cached.conn) return cached.conn;
1516

1617
if (!cached.promise) {
1718
cached.promise = mongoose.connect(MONGODB_URI, {
18-
useNewUrlParser: true,
19-
useUnifiedTopology: true,
19+
// useNewUrlParser: true,
20+
// useUnifiedTopology: true,
2021
}).then((mongoose) => mongoose);
2122
}
2223

src/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"isolatedModules": true,
1414
"jsx": "preserve",
1515
"incremental": true,
16+
"noImplicitAny": false,
1617
"plugins": [
1718
{
1819
"name": "next"

0 commit comments

Comments
 (0)