Phase 12: share an event with co-hosts
The owner shares an event by email; a co-host gets full access inside it but can't delete it or change who it's shared with. Shares are keyed by email so an admin can be added before their first login, and RLS (not the UI) is what enforces the owner-only parts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,13 @@ export const eventSchema = z.object({
|
||||
eventDate: z.union([z.iso.date("Pick a valid date."), z.literal("")]),
|
||||
});
|
||||
|
||||
/** A co-host's email, normalised the way event_cohosts stores it (trimmed, lower case). */
|
||||
export const cohostEmailSchema = z
|
||||
.string()
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.pipe(z.email("Enter a valid email address.").max(254, "That email is too long."));
|
||||
|
||||
export const teamSchema = z.object({
|
||||
name: text(60, "Team name"),
|
||||
color: z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Pick a colour."),
|
||||
|
||||
Reference in New Issue
Block a user