Init create/admin call links flow

This commit is contained in:
Jamie Kyle 2024-06-10 08:23:43 -07:00 committed by GitHub
parent 53b8f5f152
commit f19f0fb47d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 1256 additions and 149 deletions

View file

@ -3,6 +3,7 @@
import type { ReadonlyDeep } from 'type-fest';
import { z } from 'zod';
import type { ConversationType } from '../state/ducks/conversations';
import { safeParseInteger } from '../util/numbers';
export enum CallLinkUpdateSyncType {
Update = 'Update',
@ -28,9 +29,9 @@ export enum CallLinkRestrictions {
export const callLinkRestrictionsSchema = z.nativeEnum(CallLinkRestrictions);
export function toCallLinkRestrictions(
restrictions: number
restrictions: number | string
): CallLinkRestrictions {
return callLinkRestrictionsSchema.parse(restrictions);
return callLinkRestrictionsSchema.parse(safeParseInteger(restrictions));
}
/**