Files
barcofourie f5d9cb1b60 feat: adds link conversation support form (#40553)
* feat: adds link conversation support form

* style: fixes prettier styling issues

* fix: type checking errors

* feat: adds redirect to 404 for self hosted

* style: prettier formatting
2025-11-20 08:23:20 -07:00

28 lines
848 B
TypeScript

import { z } from 'zod'
import { CATEGORY_OPTIONS, type ExtendedSupportCategories } from './Support.constants'
import { NO_ORG_MARKER } from './SupportForm.utils'
export const LinkSupportTicketFormSchema = z.object({
conversation_id: z.string().min(1, 'Conversation ID is required'),
organizationSlug: z
.string()
.min(1, 'Please select an organization')
.refine((val) => val !== NO_ORG_MARKER, {
message: 'Please select an organization',
}),
projectRef: z.string().optional(),
category: z.enum(
CATEGORY_OPTIONS.map((opt) => opt.value) as [
ExtendedSupportCategories,
...ExtendedSupportCategories[],
],
{
required_error: 'Please select a category',
}
),
allowSupportAccess: z.boolean(),
})
export type LinkSupportTicketFormValues = z.infer<typeof LinkSupportTicketFormSchema>