Skip to content

Commit c1f7912

Browse files
fix: modulus of keycount
1 parent f2fd587 commit c1f7912

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/api/upload/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function POST(req: Request) {
3030
}
3131
const count: number = await Paper.countDocuments();
3232

33-
const configIndex = cloudinaryConfigs[count % 2];
33+
const configIndex = cloudinaryConfigs[count % cloudinaryConfigs.length];
3434
cloudinary.v2.config(configIndex);
3535
const uploadPreset = process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET;
3636
const formData = await req.formData();

0 commit comments

Comments
 (0)