File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Task, { ITask } from "@/models/Task";
3
3
import { NextResponse } from "next/server" ;
4
4
5
5
// To handle a GET request to /api
6
- export async function GET ( request ) {
6
+ export async function GET ( ) {
7
7
await connectToDatabase ( ) ;
8
8
const tasks : ITask [ ] = await Task . find ( { } ) ;
9
9
return NextResponse . json ( tasks , { status : 200 } ) ;
Original file line number Diff line number Diff line change @@ -8,15 +8,16 @@ if (!MONGODB_URI) {
8
8
console . warn ( 'database defined' )
9
9
}
10
10
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 } ;
12
13
13
14
async function connectToDatabase ( ) {
14
15
if ( cached . conn ) return cached . conn ;
15
16
16
17
if ( ! cached . promise ) {
17
18
cached . promise = mongoose . connect ( MONGODB_URI , {
18
- useNewUrlParser : true ,
19
- useUnifiedTopology : true ,
19
+ // useNewUrlParser: true,
20
+ // useUnifiedTopology: true,
20
21
} ) . then ( ( mongoose ) => mongoose ) ;
21
22
}
22
23
Original file line number Diff line number Diff line change 13
13
"isolatedModules" : true ,
14
14
"jsx" : " preserve" ,
15
15
"incremental" : true ,
16
+ "noImplicitAny" : false ,
16
17
"plugins" : [
17
18
{
18
19
"name" : " next"
You can’t perform that action at this time.
0 commit comments