Change POST to GET for view counter
This commit is contained in:
parent
4f6d82bc7b
commit
8b7301d0da
2 changed files with 2 additions and 13 deletions
|
|
@ -315,7 +315,7 @@ const {
|
|||
if (viewsEl?.dataset?.postId) {
|
||||
const postId = viewsEl.dataset.postId;
|
||||
|
||||
fetch(`/api/increment-views?postId=${postId}`, { method: 'POST' })
|
||||
fetch(`/api/increment-views?postId=${postId}`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (data.views !== undefined) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue