fix: Import size should use larger of AWS_S3_UPLOAD_MAX_SIZE and MAX_IMPORT_SIZE

closes #4899
This commit is contained in:
Tom Moor
2023-02-19 19:18:31 -05:00
parent f63441c15d
commit 667ffdeaf1
2 changed files with 14 additions and 12 deletions

View File

@@ -65,10 +65,10 @@ export default class AttachmentHelper {
*/
static presetToMaxUploadSize(preset: AttachmentPreset) {
switch (preset) {
case AttachmentPreset.Avatar:
return Math.min(1024 * 1024 * 5, env.AWS_S3_UPLOAD_MAX_SIZE);
case AttachmentPreset.Import:
return env.MAXIMUM_IMPORT_SIZE;
case AttachmentPreset.Avatar:
case AttachmentPreset.DocumentAttachment:
default:
return env.AWS_S3_UPLOAD_MAX_SIZE;
}