MarkWiltberger / vue-nest-web-app__realtor-app

realtor-app built on vue-nest scaffolding
1 stars 0 forks source link

Make it so only the realtor who created home can update or delete 0028 #34

Closed MarkWiltberger closed 1 month ago

MarkWiltberger commented 1 month ago

This PR

As according to the issue,

Make it so that when the updateHome or deleteHome services is called, if the user logged in is not the same as the realtor user who created the home listing, the update or delete is not allowed and an unauthorized exception is thrown.

This is done by importing the UnauthorizedException package into home.controller.ts.

A function is created in home.service.ts to get the realtor id which created the home, so that it can be compared with the logged in user. If it is not the same, instead of the update or delete service being called, an Unauthorized Exception is thrown.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vue-nest-realtor-app-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 7:12pm
vue-nest-web-app-realtor-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 7:12pm