mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 21:05:06 +03:00
* 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
28 lines
848 B
TypeScript
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>
|