Dynamic Links re-integrate with availability logic#3687
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
I agree. I have that planned as a follow up which speeds up the re-integration of dynamic links while allowing time for the edge-case availability issues to be resolved in the mean time. |
emrysal
left a comment
There was a problem hiding this comment.
Just minor comments, looking good 👍
All make sense. I had missed them out somehow, had put them in place to narrow-down the typesafety issues 😅 |
zomars
left a comment
There was a problem hiding this comment.
Nice work so far @alishaz-polymath have some nitpicks and Qs here and there. Will block merge in the meantime. 🙏
| const users = await ctx.prisma.user.findMany({ | ||
| where: { | ||
| username: { | ||
| in: usernameList as string[], |
There was a problem hiding this comment.
Can this be inferred? I see that it's coming from input which should be already typed from a zod schema
There was a problem hiding this comment.
Since the usernameList can be a null array as well, if we don't do this, it'll throw a type error stating Type 'null' is not assignable to type 'string', even though it'll only ever be called when usernameList isn't null. This just clears out that type error.
There was a problem hiding this comment.
I see that it's coming from input which should be already typed from a zod schema
So yeah, and the zod schema has it as nullable array, hence the typecasting
There was a problem hiding this comment.
But... do we accept null arrays as inputs? If we don't let's make it not optional or non-nullable. That's the point of validating. We need to check or filter our nulls anyways don't we?
| }, [telemetry]); | ||
|
|
||
| // get dynamic user list here | ||
| const userList = eventType.users.map((user) => user.username).filter(notEmpty); |
There was a problem hiding this comment.
Filtered out empty usernames instead of accepting null values
What does this PR do?
This PR re-integrates the Dynamic Group booking feature with the new availability Logic, allowing us to use dynamic group bookings again 🚀
Fixes #3409
Environment: Staging(main branch)
Type of change
How should this be tested?