I have a logout controller for admin that looks like this:
req.admin.tokens = req.admin.tokens?.filter((token: any) => {
return token.token !== req.token
})
await req.admin.save()
}```
And the route that uses the logout controller looks like this:
```adminRoute.post('/logout', adminController.logout)```
Now the error is in adminController.logout and it says:
```Argument of type '(req: IReqAdmin, res: Response, next: NextFunction) => Promise<void>' is not assignable to parameter of type 'Application<Record<string, any>>'.```
The IReqAdmin interface looks like this:
```export interface IReqAdmin extends Request{
token?: string,
admin: IAdmin
}
// The IAdmin interface:
export interface IAdmin extends mongoose.Document{
username: string,
password: string,
tokens?: {token?: string}[],
generateAuthToken(): string
}```
How can I fix this?
Thanks in advance!