RoboHome-Web is the codebase that represents the frontend of the RoboHome project. The web interface provides a way to create users, add and manage devices, and an additional way to control devices. :robot: :house_with_garden:
GNU General Public License v3.0
8
stars
17
forks
source link
Use User's model "ownsDevice" function instead of reimplementation #132
The doesUserOwnDevice function in the API's DevicesController is no longer needed and should have been removed a while ago in favor of the implementation of ownsDevice present in the User model.
Motivation and Context
Clearer more concise use of existing methods. Also makes testing a bit easier.
How Has This Been Tested?
Added new unit tests and used Insomnia to hit the info endpoint with various different parameters to make sure 200, 401, and 404 errors are produced by the info endpoint as expected.
Screenshots (if appropriate):
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[X] Enhancement (non-breaking change which is not noticeable to end users)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[X] I created a feature branch and did not open a pull request from my master branch.
[X] My code follows the code style of this project.
[ ] My change requires an update to the README and I have updated it accordingly.
[X] I have read the CONTRIBUTING document.
[X] I have added tests to cover my changes.
[X] This is a complete change and doesn't leave the project in a bad state.
Description
The
doesUserOwnDevice
function in the API'sDevicesController
is no longer needed and should have been removed a while ago in favor of the implementation ofownsDevice
present in theUser
model.Motivation and Context
Clearer more concise use of existing methods. Also makes testing a bit easier.
How Has This Been Tested?
Added new unit tests and used Insomnia to hit the
info
endpoint with various different parameters to make sure 200, 401, and 404 errors are produced by theinfo
endpoint as expected.Screenshots (if appropriate):
Types of changes
Checklist:
master
branch.