Chirag4904 / timetable

0 stars 2 forks source link

`/teachers`: alloted subjects are returned in the teachers list #20

Closed RoguedBear closed 1 year ago

RoguedBear commented 1 year ago

I'll take a look at it. thnx

RoguedBear commented 1 year ago

fixed it. apparently it was happening because id was of the type int but input passed in from the query parameter was of type string. even though mongooose typecasts the input automatically, it does not use that result in $match aggregate operator so we get a null result.

explicitly typecasting to integer if possible has fixed the issue (tho there is potential to improve this quick fix) in the teachers api and the subjects api as well