Bad Request when update the event
Closed this issue · 5 comments
ianzone commented
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 commented
the sdk should omit the event.visibility when sending the update request.
relaxedtomato commented
@ianzone have you tried specifying 'null' as default, does that work for you?
ianzone commented
@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.
mrashed-dev commented
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 commented
approach to fix: Need to ensure to nullify visibility before sending the payload if visibility is an empty string