Skip to content

remove user from company fix#95

Merged
mmartinic merged 1 commit intointercom:masterfrom
savicprvoslav:master
Oct 2, 2016
Merged

remove user from company fix#95
mmartinic merged 1 commit intointercom:masterfrom
savicprvoslav:master

Conversation

@savicprvoslav
Copy link
Contributor

Hello,
I have fixed a bug Cannot remove users from Company #70 .

Lets observe this code:

Company company = ...
Map<String, String> propertyMap = Maps.newHashMap();
propertyMap.put("company_id", company.getCompanyID());

User user = Company.listUsers(propertyMap).next();//get first user from the list


// remove user from company, important note is that this user already has company in his CompanyCollection.
user.removeCompany(company); 
...

In the line where removeCompany is called we add company to RemoveCompanyCollection and this is good part but company is not removed from CompanyCollection and at the same time we allow adding already removed company. This results in not removing the user from company.

Solution to the problem is to filter CompanyCollection and remove all Companies from RemoveCompanyCollection.

@savicprvoslav
Copy link
Contributor Author

We @ yanado.com are thinking of using this library for our cause but due doe company removal bug we are unable to continue.

Could you let me know if you plan to use this fix or not so that we can continue off from my fork?

Thank you .

@mmartinic mmartinic mentioned this pull request Oct 2, 2016
@mmartinic mmartinic merged commit 4c47488 into intercom:master Oct 2, 2016
@mmartinic
Copy link
Contributor

Hi @savicprvoslav, thanks for fixing this! Sorry it took so long to merge

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