Skip to content

Commit

Permalink
fix pro file uploadthing
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangShuuu committed Nov 17, 2023
1 parent 3a99e72 commit e5a1ef2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/api/uploadthing/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ const onUploadComplete = async ({
const isFreeExceeded = pagesAmt > PLANS.find((plan) => plan.name === 'Free')!.pagesPerPdf

if ((isSubscribed && isProExceeded) || (!isSubscribed && isFreeExceeded)) {
return await db.file.update({
await db.file.update({
data: {
uploadStatus: 'FAILED'
},
where: {
id: createdFile.id
}
})
return
}

// vectorize and index entire document
Expand Down

0 comments on commit e5a1ef2

Please sign in to comment.