-
Notifications
You must be signed in to change notification settings - Fork 27
Feature/team1/Issue71/completeAzureUsersUserIdFunction #89
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
Feature/team1/Issue71/completeAzureUsersUserIdFunction #89
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general comment is that we probably don't want any of the react code in this PR. Maybe you just need to update from upstream/development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I cannot actually run the functions on my local machine, I can only make comments. Overall, good logging implementation!
@@ -23,30 +32,48 @@ def main(req: func.HttpRequest) -> func.HttpResponse: | |||
id = req.route_params.get('userId') | |||
if not id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is necessary, because if there is no id, it basically triggers "/users" endpoint. if you test it without id you'll notice it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! You are right. I removed this part since it is not necessary
… of https://github.com/theKunte/ad440-winter2021-thursday-repo into feature/team1-issue71-completeAzureUsersUserIdFunction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed merging you branch will cause deleting the react app from NSC repo, we need to update you branch with NSC first.
Merge latest changes from NSC into fork
tested, all the functionalities are working, good to merge. |
Resolves Task/BUG :#71
To Test API function users/{userId}
Test this function on Azure:
This code completes the implementation of the Azure function for the previous PR #49 that is already merged into the dev branch
The following methods got implemented and Updated: GET/POST/PUT/PATCH/DELETE
Once this PR gets approved the function will be deployed automatically into the development branch
To test this feature locally make sure to have the following:
-In local.settings.json at the root of the functions folder, enter in the values for the keys below in the following format: { "Values": { "KEY": "VALUE" } }
ENV_DATABASE_NAME (name of the database)
ENV_DATABASE_PASSWORD
ENV_DATABASE_SERVER (this is the server location)
ENV_DATABASE_USERNAME
You can click F5 or click run->Start Debugging in the functions folder to start it up
The GET request takes the userId and returns all a specific user by their Id.
The POST request is not allowed for this call.
The PUT request takes a JSON object { "firstName": "add your firstname", "lastName": "add your last name", "email": "[email protected]" } and will update the user firstName, lastName, email when you select a specific userId.
The DELETE request takes the userId and deletes the user from the database.
-To test using JSON, copy the link provided by the debugger (the "/users/{userId}" ) into Postman, and use as usual for GET and PUT (info goes into the body), DELETE (userId). PUT and PATCH are not allowed
Error handling and Debug handling included in this feature