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

Unable to update Person.Email #79

Open
AshleyTuring opened this issue Apr 22, 2021 · 2 comments
Open

Unable to update Person.Email #79

AshleyTuring opened this issue Apr 22, 2021 · 2 comments
Labels
question Further information is requested

Comments

@AshleyTuring
Copy link

Describe the bug
Unable to UPDATE a person's email address using EDIT

To Reproduce
var currentPerson = client.Person.Get(personId).Result;
currentPerson.Email = new List { new Email{ Primary = true, Label = "work", Value = @"[email protected]" } };
var personUpdate = currentPerson.ToUpdate();
var res2 = client.Person.Edit(personId, personUpdate).Result;

It seems to be PUTing the right data but it just wont update
image

Expected behavior
Email address to appear in Pipedrive

@AshleyTuring
Copy link
Author

Other fields seem to work fine

@DavidRouyer
Copy link
Owner

Hi, thank you for your report!

You have to call ToUpdate() before editing your object, take a look at this working example:

var person = await client.Person.Get(627);

var updatedPerson = person.ToUpdate();

updatedPerson.Email.Add(new Email() { Label = "work", Primary = true, Value = "[email protected]" });

await client.Person.Edit(person.Id, updatedPerson);

@DavidRouyer DavidRouyer added the question Further information is requested label May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants