Skip to content

Commit

Permalink
Fix white space
Browse files Browse the repository at this point in the history
  • Loading branch information
timuric committed Aug 21, 2024
1 parent bb15906 commit b1b3eb2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/app/api/demo-payment/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const removeWhiteSpace = (str: string): string => {
return str.replaceAll(/[\t\n]+/g, " ");
};

const url = `https://${process.env.VERCEL_BRANCH_URL}`;

export async function GET() {
Expand Down Expand Up @@ -28,7 +32,7 @@ export async function GET() {
{
name: "Transaction initialize",
asyncEvents: ["TRANSACTION_INITIALIZE_SESSION"],
query: `
query: removeWhiteSpace(`
subscription {
event {
... on TransactionInitializeSession {
Expand All @@ -44,14 +48,14 @@ export async function GET() {
idempotencyKey
}
}
}`.replaceAll("\t", ""),
}`),
targetUrl: `${url}/api/demo-payment/transaction-initialize`,
isActive: true,
},
{
name: "Gateway initialize",
asyncEvents: ["PAYMENT_GATEWAY_INITIALIZE_SESSION"],
query: `
query: removeWhiteSpace(`
subscription {
event {
... on PaymentGatewayInitializeSession {
Expand All @@ -60,7 +64,7 @@ export async function GET() {
data
}
}
}`.replaceAll("\t", ""),
}`),
targetUrl: `${url}/api/demo-payment/gateway-initialize`,
isActive: true,
},
Expand Down

0 comments on commit b1b3eb2

Please sign in to comment.