TryCatchLearn / DatingApp-v6

588 stars 340 forks source link

Update MessageParams.cs #20

Closed GusGusGusGus closed 1 month ago

GusGusGusGus commented 2 months ago

I noted that Postman's Get Default Messages for Lisa request wouldn't work when the MessageParams where not sent along with the request, so I was getting a 'Bad Request Username not sent' as a response (even though the MessagesController uses the logged in user as a User and the repo deals with a default case where the container is absent).. I investigated further and found that one cannot NOT send parameters that where marked with the [FromQuery] attribute when those are strongly typed IF the properties on that type are not nullable or haven't had a default value. This simple fix corrects that.