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

nsc-events-nestjs-8-127-archiveActivityById-conditional-toggle #128

Merged

Conversation

bennettsf
Copy link
Contributor

@bennettsf bennettsf commented Jun 9, 2024

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:

Copy link
Contributor

@taylorpapke taylorpapke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me:
true:
Screenshot 2024-06-09 at 2 18 44 PM
false:
Screenshot 2024-06-09 at 2 18 59 PM

@brinkbrink brinkbrink merged commit 71993b8 into main Jun 9, 2024
3 checks passed
@brinkbrink brinkbrink deleted the feature-127-archiveActivityById-conditional-toggle branch June 9, 2024 21:55
@bennettsf bennettsf self-assigned this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants