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

Bad Request when update the event #470

Closed
ianzone opened this issue Jun 22, 2023 · 5 comments · Fixed by #507
Closed

Bad Request when update the event #470

ianzone opened this issue Jun 22, 2023 · 5 comments · Fixed by #507

Comments

@ianzone
Copy link

ianzone commented Jun 22, 2023

Source code

import { getConnection } from '../client';

const nylas = getConnection()

async function update(id:string) {
  const event = await nylas.events.find(id)
  event.title='new title'
  const res = await event.save()
  console.log(res)
}

update('et0kr6fovbr5syanag4f7pf7w')

Error msg Bad Request: Visibility cannot have the value ''

@ianzone ianzone added the bug label Jun 22, 2023
@ianzone
Copy link
Author

ianzone commented Jun 22, 2023

the sdk should omit the event.visibility when sending the update request.

@relaxedtomato
Copy link
Contributor

@ianzone have you tried specifying 'null' as default, does that work for you?

@ianzone
Copy link
Author

ianzone commented Sep 8, 2023

@ianzone have you tried specifying 'null' as default, does that work for you?

There is always a remedial measure, but my point is the SDK should do the job as the docs described.
image

@mrashed-dev
Copy link
Collaborator

Thanks for raising this point @ianzone. I have just reproduced the issue and we'll be looking to fix this. Thank you for reporting it!

@relaxedtomato
Copy link
Contributor

relaxedtomato commented Sep 28, 2023

approach to fix: Need to ensure to nullify visibility before sending the payload if visibility is an empty string

mrashed-dev added a commit that referenced this issue Nov 28, 2023
Closes #470, fixes the issue "Bad Request: Visibility cannot have the value ''".
mrashed-dev added a commit that referenced this issue Nov 29, 2023
# Changelog
* Add support for logging (#508, #456)
* Nullify replyToMessageId is an empty string (#484, #509)
* Nullify visibility if visibility is an empty string (#507, #470)
* Fix numbers defaulting to 0 instead of null (#469)
* Fix parsing of Number arrays (#503, #502)
* Fix configured timeout not being used (#506, #489)
* Bump `node-fetch` dependency from 2.6.1 to 2.6.12 (#504, #496)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants