encode uuid to be accepted by google

I'm querying google's calendar api and i get back some 400's due to invalid id. i read on their docs what they match and have concluded they don't support cuid (cuid uses letters up to z and google accept a-v), so i changed to uuid but i keep getting back 400 and so i tried removing the separating dashes to make it happy. is there a proper way to do this encoding/decoding? right now i did a pretty nasty hack with regex (to remove when posting google's api) and split (to add them back when querying the api). the id's in my db uses prisma's generated uuid so they have dashes, hence i need the dashes in order to be able to match them. tldr; what's the proper way to encode/decode uuid?
5 Replies
andersgee
andersgee3y ago
I messed around with google calendar api last year, not sure I completely understand your issue, but I just kept an extra id "eventId" string in my database and let google pick it. It is returned when creating events
julius
juliusOP3y ago
so this is ok
julius
juliusOP3y ago
this isnt
julius
juliusOP3y ago
and neither is this
julius
juliusOP3y ago
that thought crossed my mind but since we already get an id by prisma i don't see why i wouldn't be able to use that
Want results from more Discord servers?
Add your server