nsc-events-nestjs-8-127-archiveActivityById-conditional-toggle #128
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.
Resolves #445
This PR is a change to the archiveActivityById service function. Currently. the function only works one way for archiving an event. I want to give it functionality to unarchive an event with the same PUT API call. This will allow current archived events able to be unarchived through the same process.
In order to test this, just head over to postman and use
http://localhost:3000/api/events/archive/<id>
as your request. Make sure to input a valid event ID from your local database. It should look something like this:Next, set up authorization by copy and pasting a valid admin token in the authorization tab (using Bearer Token):
If you need help finding a valid token, send me a message and I'll help set it up.
When you send your request, you should notice the "isArchived" property change to true or false (depending on the current value). Send the request again to see it switch back. This is what it should look like: