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

Handle remove by rule ids #38

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

alonisser
Copy link

Also previous commits to handle error logging, mostly became unneeded with changes in the lib

lib/rules.js Outdated Show resolved Hide resolved
@alonisser
Copy link
Author

?

@tbreeding
Copy link

tbreeding commented Oct 2, 2019

Do you mind adding the method to the Readme? Also, thanks for this and we're going to use your fork.

@alonisser
Copy link
Author

Do you mind adding the method to the Readme? Also, thanks for this and we're going to use your fork.

I'll add in the readme. and I'm also using the fork for now, but I do hope this would get merged

@demian85
Copy link
Owner

demian85 commented Oct 2, 2019

Can someone please test if this works? I cannot merge untested changes and I'm not using this lib anymore. A bunch of unit tests will be good and greatly appreciated.

@alonisser
Copy link
Author

Thanks @demian85 are there unit tests in this lib? I failed to find them. Can you point me and I'll write one?

@tbreeding
Copy link

Do you mean just tell you if it works or write tests for it? I can tell you that it works because I'm using right now.

@@ -1,6 +1,6 @@
{
"name": "gnip",
"version": "2.2.3",
"version": "2.2.4",
Copy link
Owner

Choose a reason for hiding this comment

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

What about version in package.json? They should match.

Copy link
Author

Choose a reason for hiding this comment

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

This was bumped in my side because I use this as a stop gap until this pr is merged And bumped when npm version -
When you do an npm version on your side you'll bump it.. or just edit the PR, if I do it in my side I'll break my existing code
Another way around this would be that I would bump to version 2.2.5 -
What would you prefer?

@thisispete
Copy link

Any updates on this PR? would be handy to have delete by ID in my current project.

@alonisser
Copy link
Author

@thisispete for now you can use my branch which I use with delete by id for a long time

Comment on lines +89 to +98
request.post({
url: this._api + '?_method=delete',
json: json,
headers: { 'Authorization': this._auth }
}, function (err, response, body) {
if (err) cb(err);
else if (response.statusCode >= 200 && response.statusCode < 300) cb(null, body);
else cb(new Error('Unable to delete rules. Request failed with status code: ' + response.statusCode + 'body: '+ JSON.stringify(body)));
});
};
Copy link
Owner

Choose a reason for hiding this comment

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

Can you extract this logic so we can reuse it in the method above? It is the same, except the payload is different. After this change, I can merge and release a new minor version later today,.

@demian85
Copy link
Owner

Please check my comment above and resolve conflicts.

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.

4 participants