-
Notifications
You must be signed in to change notification settings - Fork 75
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
Resolved issue #1258, adds feature to PUT /org/{shortname} to update new last_active
field.
#1262
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jdaigneau5
approved these changes
Aug 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes Issue #1258
Summary
Adds a new field
last_active
to the Org schema, and updates this field toDate.now()
when PUT /org/{shortname} is hit. Only a secretariat can use this endpoint to make changes to fields other thanlast_active
.Important Changes
src/controller/org.controller/index.js
mw.onlySecretariat
withmw.validateOrg
-- all Orgs can now call this endpoint, but only secretariats can use this endpoint to make changes to fields other thanlast_active
src/controller/org.controller/org.controller.js
last_active
field, and only allow secretariats to make other changes.src/middleware/middleware.js
validateOrg
checks to see if either 1) the requester is the secretariat, or 2) the requester is trying to make changes to their own org. If one of these cases is true, continue with the request. Otherwise, return 403 forbidden.src/model/org.js
last_active
field to org schematest/integration-tests/org/putOrgTest.js
Testing
Steps to manually test updated functionality
npm run test:integration
] 1) Run integration test suitenpm run test:unit-tests
] 1) Run unit test suiteNotes
time.modified
field also updates when endpoint is called