Giter Site home page Giter Site logo

Comments (6)

dehora avatar dehora commented on June 12, 2024

Thanks for that @LeoIannacone. There's a beta release, 1.3.0-b2, here https://bintray.com/intercom/intercom-maven/intercom-java/1.3.0-b2/view that has support for removing companies removeCompany(Company company) on the User if you want to give that a try.

from intercom-java.

LeoIannacone avatar LeoIannacone commented on June 12, 2024

Thanks for being so responsive.

I tried it, but seems nothing changed in the request. The debug log still show only this info for company in user:

...
companies: [{
    "name" : "My Cmp",
    "company_id" : "random ID"
  }]
...

According with the doc, both the "id" and the "remove" field should be passed.

from intercom-java.

dehora avatar dehora commented on June 12, 2024

@LeoIannacone I'm only able to replicate non-removal so far if the user object is submitted to API with a company that is in the list twice, as both an add and remove. Can you put a gist together showing the sequence of calls you're making?

from intercom-java.

LeoIannacone avatar LeoIannacone commented on June 12, 2024

I'm exactly doing what you do:

  • get the user via User.find
  • get the companies collection
  • check the difference between that list and the one I have in my db
  • remove companies if needed
  • update user

from intercom-java.

broilogabriel avatar broilogabriel commented on June 12, 2024

I'm with the same problem here. Let's suppose I'm running the code below (Scala) for a company with only one user associated:

val user = User.find(Map("user_id" -> userId.toString).asJava)
val company = Company.find(Map("company_id" -> companyId.toString).asJava)
user.removeCompany(company)
User.update(user)

This code seems to work for the user, but if searched by the company again and and call the method getTotalCount it shows the user still associated and you'll be able to see the association in the app dashboard.

from intercom-java.

mmartinic avatar mmartinic commented on June 12, 2024

should be fixed with #124

from intercom-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.