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

Fix leancloud counter bug #1093

Merged
merged 1 commit into from
Aug 15, 2019
Merged

Conversation

littleylv
Copy link
Contributor

@littleylv littleylv commented Aug 15, 2019

PR Type

  • Bugfix.

What is the current behavior?

Bug from this commit: cbf6041#diff-d4f96cf2cea92b9d7c8d95bb034e2eb2R13

In post page, cleancloud counter api returns all data then use the first item var counter = results[0];

What is the new behavior?

In post page, cleancloud counter api returns current url correctly.

Does this PR introduce a breaking change?

  • Yes.
  • No.

@welcome
Copy link

welcome bot commented Aug 15, 2019

Thanks so much for opening your first PR here!

@CLAassistant
Copy link

CLAassistant commented Aug 15, 2019

CLA assistant check
All committers have signed the CLA.

@stevenjoezhang
Copy link
Contributor

leancloud counter api returns all data

@littleylv Can you confirm that? Seems that the Response body is the same after this PR

Request URL: https://piu0nmph.api.lncldglobal.com/1.1/classes/Counter?{%22where%22:%22/2019-08/%E5%A4%B1%E5%8E%BB%E5%90%8C%E6%AD%A5/%22}
Response body: {"results":[{"title":"\u5931\u53bb\u540c\u6b65","url":"/2019-08/\u5931\u53bb\u540c\u6b65/","time":8,"createdAt":"2019-08-13T18:23:34.503Z","updatedAt":"2019-08-15T03:42:20.463Z","objectId":"5d53002610004d0008602613"}]}

Request URL: https://piu0nmph.api.lncldglobal.com/1.1/classes/Counter?where={%22url%22:%22/2019-08/%E5%A4%B1%E5%8E%BB%E5%90%8C%E6%AD%A5/%22}
Response body: {"results":[{"title":"\u5931\u53bb\u540c\u6b65","url":"/2019-08/\u5931\u53bb\u540c\u6b65/","time":8,"createdAt":"2019-08-13T18:23:34.503Z","updatedAt":"2019-08-15T03:44:08.882Z","objectId":"5d53002610004d0008602613"}]}

@littleylv
Copy link
Contributor Author

littleylv commented Aug 15, 2019

@stevenjoezhang Yes, you can check my blog here: https://littleylv.github.io/2016/01/new-post/

https://mxgxbwwf.api.lncldglobal.com/1.1/classes/Counter?{%22where%22:%22/2016/01/new-post/%22}
1

which means query key is {"where":"/2016/01/new-post/"} and query value is null

the response is :
2

十月初壹
Hello World!

@stevenjoezhang
Copy link
Contributor

@littleylv Thanks. Maybe you can use encodeURIComponent instead of JSON.stringify?

@stevenjoezhang stevenjoezhang added this to the v7.4.0 milestone Aug 15, 2019
@littleylv
Copy link
Contributor Author

@stevenjoezhang I don't think so. I should just revert it to the older version before cbf6041

@stevenjoezhang stevenjoezhang merged commit 3c09409 into theme-next:master Aug 15, 2019
@welcome
Copy link

welcome bot commented Aug 15, 2019

Congrats on merging your first pull request here! 🎉 How awesome!

@1v9
Copy link
Member

1v9 commented Aug 15, 2019

@all-contributors please add @littleylv for bug

@allcontributors
Copy link
Contributor

@1v9

I've put up a pull request to add @littleylv! 🎉

tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants