Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Add command to star a problem #11

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

Merged
merged 2 commits into from
Oct 12, 2016
Merged

Add command to star a problem #11

merged 2 commits into from
Oct 12, 2016

Conversation

wong2
Copy link
Contributor

@wong2 wong2 commented Oct 11, 2016

Usage: lc star 396

if (e) return log.fail(e);
core.starProblem(problem, function(e) {
if (e) return log.fail(e);
log.info(h.prettyText(' Starred', true));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks dude, overall LGTM. Just wondering what if run 'lc star 1' twice, will it be un-starred in the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skygragon nope, the api is idempotent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unstar is done by sending a DELETE request to the same endpoint

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think that is good enough for the moment. I guess there will be more patches to address related functions like 'unstar'. Also want to update local cache whenever is_favor is updated in problem json.

@skygragon skygragon merged commit 7e3464b into skygragon:master Oct 12, 2016
tainenko pushed a commit to tainenko/leetcode-cli that referenced this pull request Sep 27, 2019
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