Escape backslashes in PO duplicate-check filter for consistency with matchSite
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a295d9ea18
commit
38844b29d4
1 changed files with 1 additions and 1 deletions
|
|
@ -55,7 +55,7 @@ export async function POST(request: Request) {
|
|||
// 5. Idempotency: check for existing po_number
|
||||
try {
|
||||
const existing = await pb.collection("purchase_orders").getFullList({
|
||||
filter: `purchase_order_number = "${payload.po_number.replace(/"/g, '\\"')}"`,
|
||||
filter: `purchase_order_number = "${payload.po_number.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`,
|
||||
});
|
||||
if (existing.length > 0) {
|
||||
return NextResponse.json(
|
||||
|
|
|
|||
Loading…
Reference in a new issue