-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: RSVP #6039
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
feat: RSVP #6039
Conversation
… checks and key improvements
… update possible types
Deploying hey-testnet with
|
Latest commit: |
3828243
|
Status: | ✅ Deploy successful! |
Preview URL: | https://cff20409.hey-testnet.pages.dev |
Branch Preview URL: | https://rsvp.hey-testnet.pages.dev |
Deploying hey-staging with
|
Latest commit: |
3828243
|
Status: | ✅ Deploy successful! |
Preview URL: | https://53a6659e.hey-staging.pages.dev |
Branch Preview URL: | https://rsvp.hey-staging.pages.dev |
Deploying hey-mainnet with
|
Latest commit: |
3828243
|
Status: | ✅ Deploy successful! |
Preview URL: | https://89cedf47.hey-mainnet.pages.dev |
Branch Preview URL: | https://rsvp.hey-mainnet.pages.dev |
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.
Pull Request Overview
This PR implements RSVP functionality for events by adding event creation capabilities and a new RSVP data model. The changes enable users to create event posts with metadata like title, location, and timestamps, while establishing the foundation for RSVP tracking.
Key changes:
- Added comprehensive event metadata support with GraphQL fragments and TypeScript interfaces
- Implemented event creation UI components including editor and settings
- Created RSVP database schema with status tracking (GOING, NOT_GOING, MAYBE)
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
EventMetadata.graphql | Extends event metadata fragment with title, address, location, and timing fields |
usePostEventStore.ts | Creates new store for managing event post state and editor visibility |
usePostMetadata.tsx | Integrates event metadata handling into post creation workflow |
Event.tsx | Implements event display component with date formatting and location links |
PostBody.tsx | Adds event rendering support to post body component |
NewPublication.tsx | Integrates event editor and settings into post composer |
EventSettings/index.tsx | Creates event settings toggle button with calendar icon |
EventEditor.tsx | Implements comprehensive event creation form with validation |
schema.prisma | Defines RSVP database model with composite primary key and status enum |
.env.example & README.md | Removes unused OPENROUTER_API_KEY environment variable |
content: string; | ||
startsAt: string; | ||
endsAt: string; | ||
location: 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 location field type doesn't match the GraphQL schema which expects an object with 'physical' and 'virtual' properties. This inconsistency could cause type errors when mapping between the store and metadata.
location: string; | |
location: { | |
physical: string; | |
virtual: string; | |
}; |
Copilot uses AI. Check for mistakes.
@@ -104,12 +108,17 @@ const usePostMetadata = () => { | |||
}); | |||
} | |||
|
|||
if (isEvent) { | |||
return event(eventPost); |
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 eventPost object structure doesn't match the expected event metadata schema. The location field is a string in the store but should be an object with physical/virtual properties according to the GraphQL fragment.
return event(eventPost); | |
const transformedEventPost = { | |
...eventPost, | |
location: typeof eventPost.location === "string" | |
? { physical: eventPost.location, virtual: null } | |
: eventPost.location | |
}; | |
return event(transformedEventPost); |
Copilot uses AI. Check for mistakes.
const ValidationSchema = z.object({ | ||
content: z.string().optional(), | ||
endsAt: z.string().min(1, { message: "End time is required" }), | ||
location: z.string().optional(), |
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 validation schema defines location as a string, but the GraphQL metadata expects a complex object with physical and virtual properties. This mismatch will cause issues when creating event metadata.
location: z.string().optional(), | |
location: z | |
.object({ | |
physical: z.string().optional(), | |
virtual: z.string().optional(), | |
}) | |
.optional(), |
Copilot uses AI. Check for mistakes.
apps/api/src/prisma/schema.prisma
Outdated
status RSVPStatus | ||
createdAt DateTime @default(now()) | ||
|
||
@@id([eventId, accountAddress]) |
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.
[nitpick] The composite primary key order should typically place the more selective field first. Consider using [accountAddress, eventId] instead, as account addresses are likely more selective than event IDs for query performance.
@@id([eventId, accountAddress]) | |
@@id([accountAddress, eventId]) |
Copilot uses AI. Check for mistakes.
No description provided.