Skip to content

Commit b17727a

Browse files
authored
Update exchange urlCreator (#3935)
* Update exchange urlCreator * remove log
1 parent 32b0e5d commit b17727a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pages/api/exchange/[[...params]].tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ const urlCreator = (
2424
basePath: string,
2525
) => {
2626
if (!path) return basePath
27-
const removedRouteName = path.replace(`/api/${ROUTE_NAME}`, '')
28-
const url = new URL(`${basePath}${removedRouteName}`)
27+
// query starts with /swaps, for example: swap/v4.1/1/swap?...'
28+
const replacedRouteName = path.replace(`/api/${ROUTE_NAME}`, '/swap')
29+
const url = new URL(`${basePath}${replacedRouteName}`)
2930

3031
// Add connectorTokens query param to the url if the network is mainnet
3132
if (Number(queryParams.networkId) === NetworkIds.MAINNET) {

0 commit comments

Comments
 (0)