TomDoesTech / REST-API-Tutorial-Updated

https://www.youtube.com/watch?v=BWUi6BS9T5Y
574 stars 283 forks source link

fix type error #7

Closed Ed4ru closed 2 years ago

Ed4ru commented 2 years ago

Fixed FlattenMaps type added by default with .toJSON() in mongoose (the error is showing up in session.controller.ts line 20).

I first got that error when working on a new project inspired from your tutorial. and it's also showing up when deleting the yarn.lock and rebuilding it with yarn install.

tomanagle commented 2 years ago

What's the error?

Ed4ru commented 2 years ago

Argument of type 'AnyObject | FlattenMaps' is not assignable to parameter of type 'string'. Type 'AnyObject' is not assignable to type 'string'.ts(2345)

user._id, session.controller.ts line 20