diff --git a/app/lib/actions/billActions.ts b/app/lib/actions/billActions.ts index c5b09fa..2e60045 100644 --- a/app/lib/actions/billActions.ts +++ b/app/lib/actions/billActions.ts @@ -165,7 +165,7 @@ export const updateOrAddBill = withUser(async (user: AuthenticatedUser, location } // Validate file type - if (attachmentFile && attachmentFile.type !== 'application/pdf') { + if (attachmentFile && attachmentFile.size > 0 && attachmentFile.type !== 'application/pdf') { return { success: false, error: 'Only PDF files are accepted' }; } @@ -503,7 +503,7 @@ export const uploadProofOfPayment = async (locationID: string, billID: string, f } // Validate file type - if (file && file.type !== 'application/pdf') { + if (attachmentFile && attachmentFile.size > 0 && attachmentFile.type !== 'application/pdf') { return { success: false, error: 'Only PDF files are accepted' }; }