-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
fix: bookerEmbed
atom
#18168
fix: bookerEmbed
atom
#18168
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Graphite Automations"Add platform team as reviewer" took an action on this PR • (12/13/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (12/17/24)1 label was added to this PR based on Keith Williams's automation. |
@IsString() | ||
@IsOptional() | ||
@DocsProperty() | ||
teamName?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The request is to fetch team event type, but we have added properties like weekStart
, brandColor
that makes it seem like they reside on the team event type level while in the reality all of the newly added output properties are part of a team, not team event type, and we should not mix them on the same level. We are coupling API with what atom needs too much.
So either:
- Add a new query parameter to the endpoint returning team event type which is a comma separated string
expand
to which we can pass which team event type properties we want to expand e.g.?expand=team
and then if it is passed instead return newteam
object in response (see campsite thread) - Create atoms specific endpoint that returns event type just for the atom in format it needs with all the information it needs. This would also allow us to get ride of the transformApiEventTypeForAtom.ts function.
- Quickest (albeit suboptimal) solution - define property
team
on the output under which you store all newly added properties and always return them aka it is basically the same as now but creating a nestedteam
in this output to not mix event type with team properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for now the third option of defining a team in the output seems good so I'll just go with that.
@IsInt() | ||
@IsOptional() | ||
@DocsProperty() | ||
id?: number | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Team id will be defined if the team is defined, so check prisma schema for the team and see which properties are defined and not.
@IsObject() | ||
@IsOptional() | ||
@DocsProperty() | ||
team!: Team | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add docs property did you check the docs that the team object is actually appearing in docs? Because i think first need to add @ValidateNested decorator to actually validate the team, and then add @Type(() => Team)
. Also, there might already be a dto called Team so better rename it to EventTypeTeam.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After you do this and then rebuild platform types locally and run v2 and go to http://localhost:5555/docs and confirm team is seen in output its good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
E2E results are ready! |
* update translations * add custom hook for platform embed * update event type ouput DTO response * fixup * display terms and conditions for embed * update v2 docs * PR feedback * update docs * PR feedback * update docs * update output DTO * update docs * update output typing * docs update * resolve merge conflicts * merge conflicts resolving * resolve merge conflicts * fixup * update docs
* update translations * add custom hook for platform embed * update event type ouput DTO response * fixup * display terms and conditions for embed * update v2 docs * PR feedback * update docs * PR feedback * update docs * update output DTO * update docs * update output typing * docs update * resolve merge conflicts * merge conflicts resolving * resolve merge conflicts * fixup * update docs
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Can be tested in the examples app under
packages/platform/examples/base