Line data Source code
1 : interface SupportFormIdentity {
2 : email?: string | null
3 : userId?: string | null
4 : }
5 :
6 : /** Appends the signed-in user's details as the form's pre-fill parameters. */
7 4 : export function buildSupportFormUrl(
8 : baseUrl: string,
9 : { email, userId }: SupportFormIdentity = {}
10 : ): string {
11 4 : const url = new URL(baseUrl)
12 4 : if (email) url.searchParams.set('email', email)
13 4 : if (userId) url.searchParams.set('comfy_cloud_user_id', userId)
14 4 : return url.toString()
15 : }
|