|
1 |
| -### Background/Context |
| 1 | +## What type of PR is this? (check all applicable) |
2 | 2 |
|
3 |
| -### Before and After |
| 3 | +- [ ] β»οΈ Refactor |
| 4 | +- [ ] β¨ Feature (e.g. API change) |
| 5 | +- [ ] π Bug Fix |
| 6 | +- [ ] π¨ Enhancement |
| 7 | +- [ ] π Documentation Update |
| 8 | +- [ ] π Release |
| 9 | +- [ ] π© Other |
4 | 10 |
|
5 |
| -### Acknowledgments (optional) |
| 11 | +## Context |
6 | 12 |
|
7 |
| -### Other notes (optional) |
| 13 | +**_Placeholder example below:_** |
| 14 | + |
| 15 | +Closes Issue #128 |
| 16 | + |
| 17 | +Right now, on the front-end, we need to pass in a token (i.e. the user needs to be logged in) before they can see a list of resource. |
| 18 | + |
| 19 | +``` |
| 20 | + axios |
| 21 | + .get('/api/v1/resources', { |
| 22 | + headers: { |
| 23 | + Authorization: `Bearer ${authContext.authTokens.token}`, |
| 24 | + }, |
| 25 | + }) |
| 26 | +``` |
| 27 | + |
| 28 | +This should be true for when users are creating a resource, but the list of resources on https://cb-react-concept.netlify.com/resources should be available to the public. |
| 29 | + |
| 30 | +## Other Related Tickets & Documents (as needed) |
| 31 | + |
| 32 | +**_Placeholder example:_** This relates to issue #23, and I also filed issue #43 as a next step to do after this PR is merged. |
| 33 | + |
| 34 | +## Implementation Details |
| 35 | +What was your thought process as you changed the code? What does someone need to consider in reviewing it? |
| 36 | + |
| 37 | +Placeholder example: |
| 38 | + |
| 39 | +Placeholder example: |
| 40 | +[x] Made GET /resources not protected by authorization |
| 41 | +[x] Changed setup for tests to make sure we're not authed for the GET requests, but are authed for POST, PATCH, and search. |
| 42 | +[x] Added test to make sure GET /api/v1/resources/{{guid}}/ and GET /api/v1/resources/ requests and search work without a token |
| 43 | +[x] Altered tests for GET GET /api/v1/resources/{{guid}}/ and GET /api/v1/resources/ requests and search to ensure that they also work with a token |
| 44 | +[x] Added tests to make sure PATCH and POST fail without a token |
| 45 | +[x] Added test to make sure DEL fails without a token |
| 46 | + |
| 47 | +## Related Tickets & Documents (Optional) |
| 48 | + |
| 49 | +- [ ] I've updated `requirements.txt` |
| 50 | + |
| 51 | +List the new libraries here: |
| 52 | + |
| 53 | +## Any new migration files added? |
| 54 | + |
| 55 | +- [ ] π yes |
| 56 | +- [ ] π
no, because they aren't needed |
| 57 | + |
| 58 | +## Did you add tests? |
| 59 | +**_Code added or changed without test coverage or good reason for exemption won't be approved._** |
| 60 | + |
| 61 | +- [ ] π yes |
| 62 | +- [ ] π no, because I need help |
| 63 | +- [ ] π
no, because they aren't needed |
| 64 | + |
| 65 | +## Did you add documentation? |
| 66 | + |
| 67 | +- [ ] π readme.md |
| 68 | +- [ ] π contributing.md |
| 69 | +- [ ] π wiki entry |
| 70 | +- [ ] π I'd like someone to help write documentation, and will file a new issue for it |
| 71 | +- [ ] π
no documentation needed |
0 commit comments