Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new tests to prepare the code to refactor the routes into controllers #132

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

lucasjose501
Copy link
Contributor

@lucasjose501 lucasjose501 commented Apr 3, 2022

Hello! This PR adds missing tests for api routes.

These are the tests I'm working on to prepare API code for secure refactoring and migrate code from routes to dedicated controllers and improvements in separation of concerns.

Progress:

  • Test GET /api/client/version
  • Test GET /api/login
  • Test GET /api/computers
  • Test POST /api/computers
  • Test GET /api/computers/{computer}
  • Test POST /api/computers/{computer}

@lucasjose501
Copy link
Contributor Author

Related issue: #84

@lucasjose501
Copy link
Contributor Author

@bimbashrestha Is the endpoint GET /api/user used by the client? I'm not sure if this is necessary there. Just thinking to clean up the route files later in another PR.

Route:

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {

I think it's default with sanctum...
Anyway.

Hope you like it!

@lucasjose501 lucasjose501 marked this pull request as ready for review April 5, 2022 23:21
@bimbashrestha
Copy link
Member

Thanks @lucasjose501! I'll take a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants