mirror of
https://github.com/kyantech/Palmr.git
synced 2025-10-23 06:11:58 +00:00
feat: enhance reverse share modal data mapping
- Updated the mapping function to reflect the actual properties of reverseShare, including expiration, file limits, field requirements, and password status. - Improved the handling of optional fields to ensure accurate form data representation.
This commit is contained in:
@@ -120,10 +120,11 @@ function mapReverseShareToFormData(reverseShare: ReverseShare): EditReverseShare
|
||||
pageLayout: (reverseShare.pageLayout as "DEFAULT" | "WETRANSFER") || DEFAULT_VALUES.PAGE_LAYOUT,
|
||||
nameFieldRequired: (reverseShare.nameFieldRequired as "HIDDEN" | "OPTIONAL" | "REQUIRED") || "OPTIONAL",
|
||||
emailFieldRequired: (reverseShare.emailFieldRequired as "HIDDEN" | "OPTIONAL" | "REQUIRED") || "OPTIONAL",
|
||||
hasExpiration: false,
|
||||
hasFileLimits: false,
|
||||
hasFieldRequirements: false,
|
||||
hasPassword: false,
|
||||
hasExpiration: !!reverseShare.expiration,
|
||||
hasFileLimits: !!(reverseShare.maxFiles || reverseShare.maxFileSize || reverseShare.allowedFileTypes),
|
||||
hasFieldRequirements:
|
||||
reverseShare.nameFieldRequired !== "OPTIONAL" || reverseShare.emailFieldRequired !== "OPTIONAL",
|
||||
hasPassword: reverseShare.hasPassword,
|
||||
password: DEFAULT_VALUES.EMPTY_STRING,
|
||||
isActive: reverseShare.isActive,
|
||||
noFilesLimit: !reverseShare.maxFiles,
|
||||
|
Reference in New Issue
Block a user