Having an issue with my express.js controller where I am unable to use req.params
The error message being displayed is
'Property 'id' is missing in type 'ParamsDictionary' but required in type 'IParam'.'
I need a way to retrieve the value of id
from the parameter as a string
import { Request, Response } from 'express'
interface IParam {
id: string
}
const Update = (req: Request, res: Response) => {
const { id }: IParam = req.param // The error occurs at this line
}
export default Update