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

feat(api/vote): add get vote status endpoint #998

Merged
merged 1 commit into from
Oct 6, 2024
Merged

Conversation

qwqcode
Copy link
Member

@qwqcode qwqcode commented Oct 6, 2024

A new HTTP API endpoint GET /votes/:target_name/:target_id is now available.

Response example:

{"up":1,"down":1,"is_up":true,"is_down":false}

See https://artalk.js.org/http-api.html#tag/Vote/operation/GetVote

  • Implement GET endpoint for retrieving vote status
  • Add tests for vote functionality

Related to: #997

This is a prerequisite PR for #983.

A new HTTP API endpoint `GET /votes/:target_name/:target_id` is now available.

Response example:

```
{"up":1,"down":1,"is_up":true,"is_down":false}
```

- Implement GET endpoint for retrieving vote status
- Add tests for vote functionality

Related to: PR#997

This is a prerequisite PR for #983.
Copy link

codecov bot commented Oct 6, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 33.38%. Comparing base (02a369f) to head (129b120).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
server/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #998      +/-   ##
==========================================
+ Coverage   32.16%   33.38%   +1.21%     
==========================================
  Files         206      206              
  Lines        6904     6917      +13     
==========================================
+ Hits         2221     2309      +88     
+ Misses       4529     4447      -82     
- Partials      154      161       +7     
Flag Coverage Δ
go 33.38% <92.30%> (+1.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qwqcode qwqcode merged commit 7c251fd into master Oct 6, 2024
19 checks passed
@qwqcode qwqcode deleted the feat/api/vote_get branch October 6, 2024 14:32
qwqcode added a commit that referenced this pull request Oct 6, 2024
- Introduce page voting functionality
- Update configuration to enable/disable page voting
- Retrieve html elements for voting buttons and counts
- Enhance customization options for voting elements
- Reference: #983, #998, #997
qwqcode added a commit that referenced this pull request Oct 8, 2024
* feat(plugin/page_vote): add `page_vote` plugin

* feat(plugin/page_vote): update vote count text

adjust code structure
disable `page vote` plugin by default

* feat(plugin/page_vote): reuse actions btn style

* perf(plugin/page-vote): make type strong

* feat: watch `darkMode` conf

* doc(plugin/page_vote): add config doc

* feat(ui/page_vote): add page voting feature

- Introduce page voting functionality
- Update configuration to enable/disable page voting
- Retrieve html elements for voting buttons and counts
- Enhance customization options for voting elements
- Reference: #983, #998, #997

---------

Co-authored-by: qwqcode <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant