Limit users to a single import a day
This commit is contained in:
@ -16,7 +16,7 @@ import {
|
||||
generateUploadSignedUrl,
|
||||
} from '../../utils/uploads'
|
||||
|
||||
const MAX_DAILY_UPLOADS = 4
|
||||
const MAX_DAILY_UPLOADS = 1
|
||||
const VALID_CONTENT_TYPES = ['text/csv', 'application/zip']
|
||||
|
||||
const extensionForContentType = (contentType: string) => {
|
||||
@ -61,7 +61,7 @@ export const uploadImportFileResolver = authorized<
|
||||
const dirPath = `imports/${uid}/${dateStr}/`
|
||||
const fileCount = await countOfFilesWithPrefix(dirPath)
|
||||
|
||||
if (fileCount > MAX_DAILY_UPLOADS) {
|
||||
if (fileCount >= MAX_DAILY_UPLOADS) {
|
||||
return {
|
||||
errorCodes: [UploadImportFileErrorCode.UploadDailyLimitExceeded],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user