We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aed0766 commit 932aef3Copy full SHA for 932aef3
apps/sim/app/api/v1/admin/credits/route.ts
@@ -51,6 +51,14 @@ export const POST = withAdminAuth(async (request) => {
51
return badRequestResponse('Either userId or email is required')
52
}
53
54
+ if (userId && typeof userId !== 'string') {
55
+ return badRequestResponse('userId must be a string')
56
+ }
57
+
58
+ if (email && typeof email !== 'string') {
59
+ return badRequestResponse('email must be a string')
60
61
62
if (typeof amount !== 'number' || !Number.isFinite(amount) || amount <= 0) {
63
return badRequestResponse('amount must be a positive number')
64
0 commit comments