mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Limit users to a single import a day
This commit is contained in:
parent
c722953d81
commit
9e8ccb35e3
1 changed files with 2 additions and 2 deletions
|
|
@ -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],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue