Skip to content

added owner name to share code response#370

Open
khoiddinh wants to merge 2 commits intomasterfrom
khoiddinh/gsr_share_code_patch
Open

added owner name to share code response#370
khoiddinh wants to merge 2 commits intomasterfrom
khoiddinh/gsr_share_code_patch

Conversation

@khoiddinh
Copy link
Copy Markdown
Contributor

quick addition b/c frontend needs the booking owner name and this should be done through backend


serializer = self.get_serializer(share_code.booking)
return Response(serializer.data)
user = share_code.booking.user
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code creates a nested response structure that's not consistent with the other endpoints. it's also good practice for the serializer to define what data gets returned. instead of manually wrapping it like this, an easier and cleaner approach would be to add owner_name directly to SharedGSRBookingSerializer as a field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants