dbudwin / RoboHome-Web

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

Closed dbudwin closed 6 years ago

dbudwin commented 6 years ago

Description

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

Checklist: