Skip to content

Commit

Permalink
fix: change wrong commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianwzq committed Dec 8, 2023
1 parent f74958f commit a840ab9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions shared/constants/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/** File types that can be uploaded for form image/logo */
export const VALID_UPLOAD_FILE_TYPES = ['image/jpeg', 'image/png', 'image/gif']

export const KB = 1024
export const MB = 1024 * KB
export const KB = 1000
export const MB = 1000 * KB

// Define max file size as 2MB
export const MAX_UPLOAD_FILE_SIZE = 2 * MB // 2 Million/Mega Bytes, or 2 MB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const makeAttachmentSizeValidator: AttachmentValidatorConstructor =
(attachmentField) => (response) => {
const { attachmentSize } = attachmentField
const byteSizeLimit = parseInt(attachmentSize) * MB
return response.content.byteLength > byteSizeLimit
return response.content.byteLength <= byteSizeLimit
? right(response)
: left(`AttachmentValidator:\t File size more than limit`)
}
Expand Down

0 comments on commit a840ab9

Please sign in to comment.