21 lines
601 B
TypeScript
21 lines
601 B
TypeScript
export const INVITE_COPY_QUERY = "copy";
|
|
export const INVITE_COPY_VALUE = "1";
|
|
export const CREATE_FLOW_COPIED_QUERY = "copied";
|
|
export const CREATE_FLOW_COPIED_VALUE = "1";
|
|
|
|
export function invitedRulePath(
|
|
ruleId: string,
|
|
opts?: { copy?: boolean },
|
|
): string {
|
|
const base = `/invite/${encodeURIComponent(ruleId)}`;
|
|
if (opts?.copy) {
|
|
return `${base}?${INVITE_COPY_QUERY}=${INVITE_COPY_VALUE}`;
|
|
}
|
|
return base;
|
|
}
|
|
|
|
export function inviteExpiredPath(token?: string | null): string {
|
|
if (!token) return "/invite/expired";
|
|
return `/invite/expired?token=${encodeURIComponent(token)}`;
|
|
}
|