cal.com
cal.com copied to clipboard
feat(web): case insensitive slug search
Not sure if this is something you want, but after upgrading we have lots of differently-cased event types that we still need to support 😞
The latest updates on your projects. Learn more about Vercel for Git ↗︎
@heuels is attempting to deploy a commit to the cal Team on Vercel.
A member of the Team first needs to authorize it.
I'd go as far to say it might be good to normalize always slugs to be lowercase and use only dash as separator? I know we recently had to cleanup some chars in event-slugs too... Thoughts @zomars ?
@heuels by insensitive you mean 'THIS' === 'this' right?
@zomars yes, that's right!
@heuels @agustif I see this like something desirable yes. But we should make sure it is being used consistently in the codebase. Or find a way to enable this globally:

@zomars we could add maybe a prisma middleware for this, that extends event-type calls adding the slug: { equals: slug, mode: "insensitive" }, where prop?
@heuels if you're up for it, you can checkout how we added soft-delete for bookingReference here https://github.com/calcom/cal.com/blob/main/packages/prisma/middleware/bookingReference.ts A similar approach could work for eventType-slug and maybe others in the future?
@agustif yup, that sounds great! Will get to it later this week 🙌
@heuels Were you done with your changes?
@hariombalhara I have not sadly. We deprioritized using Cal.com for now and this has fallen off my radar. Should I just close this PR?
This needs to be fixed in the middleware to catch the many, many different places we query things by slug. - further improvement but this will definitely stay on our radar for implementation. Thanks @heuels for the PR and ensuing discussions too.