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

Question: Custom API to increment views. #2166

Closed
shabbir21 opened this issue May 30, 2018 · 3 comments
Closed

Question: Custom API to increment views. #2166

shabbir21 opened this issue May 30, 2018 · 3 comments

Comments

@shabbir21
Copy link

Version Info

  • Directus version and branch (Or commit hash): 6.4.9 master
  • PHP version: 7.0.30
  • MySQL version:
  • Web server: Apache
  • OS name and version: Ubuntu 16.04

I have setup a Posts table. The table has a column views.
Is it possible to write a custom API which will increment the value of views in Posts table?

@benhaynes benhaynes added the v6 label Oct 12, 2018
@benhaynes
Copy link
Sponsor Member

benhaynes commented Oct 25, 2018

In this old version it can be accomplished with hooks:

https://github.com/directus/docs/blob/master/extensions/hooks.md

Or custom endpoints in the new API version:

https://docs.directus.io/extensions/custom-endpoints.html#creating-custom-endpoints

@shabbir21
Copy link
Author

@benhaynes
Copy link
Sponsor Member

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants