mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Enhance qaId validation in MCP review routes to ensure it is a non-negative decimal integer
This commit is contained in:
parent
16542f1103
commit
10e6cfc7a3
@ -13,7 +13,7 @@ export const POST = createSmartRouteHandler({
|
||||
project: adaptSchema,
|
||||
}).defined(),
|
||||
body: yupObject({
|
||||
qaId: yupString().defined(),
|
||||
qaId: yupString().matches(/^\d+$/, "qaId must be a non-negative decimal integer").defined(),
|
||||
}).defined(),
|
||||
method: yupString().oneOf(["POST"]).defined(),
|
||||
}),
|
||||
|
||||
@ -13,7 +13,7 @@ export const POST = createSmartRouteHandler({
|
||||
project: adaptSchema,
|
||||
}).defined(),
|
||||
body: yupObject({
|
||||
qaId: yupString().defined(),
|
||||
qaId: yupString().matches(/^\d+$/, "qaId must be a non-negative decimal integer").defined(),
|
||||
question: yupString().defined(),
|
||||
answer: yupString().defined(),
|
||||
publish: yupBoolean().defined(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user