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

gists+examples: Extend GistsHandler through star(...), unstar(...), is_starred(...) #330

Merged
merged 5 commits into from
Apr 10, 2023

Conversation

envp
Copy link
Contributor

@envp envp commented Apr 9, 2023

Adding code related to /gists/{gist_id}/star here.

TODO:

  • Star a gist (PUT /gists/{gist_id}/star)
  • Unstar a gist (DELETE /gists/{gist_id}/star)
  • Check if a gist is starred (GET /gists/{gist_id}/star)

Related to: #27

@envp envp mentioned this pull request Apr 9, 2023
@envp envp force-pushed the issue-27/star-gists branch from 2ee5c90 to 762f229 Compare April 9, 2023 18:12
@envp envp changed the title gists+examples: Extend GistsHandler by adding star(...) gists+examples: Extend GistsHandler through star(...), unstar(...) Apr 9, 2023
@envp envp force-pushed the issue-27/star-gists branch from 762f229 to cfe9a8a Compare April 9, 2023 18:29
envp added 5 commits April 9, 2023 14:45
The `star(...)` function takes a `gist_id` and 'stars' it. Has no
observable effect on the gist if it is already starred.
The `unstar(...)` function takes a `gist_id` and removes a 'star' from
it. Has no observable effect on the gist if it is not starred.
Create `GistsHandler::is_starred`. This acceepts a `gist_id` and
returns if a gist is starred.
This fully demonstrates how to:

- Check if a gist is starred
- Star a gist
- Unstar a gist
@envp envp force-pushed the issue-27/star-gists branch from 8ce1986 to ca7cd8d Compare April 9, 2023 18:54
@envp envp changed the title gists+examples: Extend GistsHandler through star(...), unstar(...) gists+examples: Extend GistsHandler through star(...), unstar(...), is_starred(...) Apr 9, 2023
@envp
Copy link
Contributor Author

envp commented Apr 9, 2023

cc: @XAMPPRocky this is ready for review. Thanks for your patience with the PR spam :^)

examples/star_unstar_a_gist.rs Show resolved Hide resolved
src/api/gists.rs Show resolved Hide resolved
@XAMPPRocky
Copy link
Owner

@envp Thank you for your PR! Spam would imply that it's unwelcome or not wanted, which I can assure you, your contributions are not. 🙂

@XAMPPRocky
Copy link
Owner

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit 756784d into XAMPPRocky:main Apr 10, 2023
Libbum pushed a commit to Libbum/octocrab that referenced this pull request Apr 10, 2023
….)`, `is_starred(...)` (XAMPPRocky#330)

* gists+examples: Extend `GistsHandler` by adding `star(...)`

The `star(...)` function takes a `gist_id` and 'stars' it. Has no
observable effect on the gist if it is already starred.

* gists+examples: Extend `GistsHandler` by adding `unstar(...)`

The `unstar(...)` function takes a `gist_id` and removes a 'star' from
it. Has no observable effect on the gist if it is not starred.

* examples: Rename star_a_gist -> star_unstar_a_gist

* gists: Add function to check if a gist is starred

Create `GistsHandler::is_starred`. This acceepts a `gist_id` and
returns if a gist is starred.

* examples: Extend the `star_unstar_a_gist` example

This fully demonstrates how to:

- Check if a gist is starred
- Star a gist
- Unstar a gist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants