Skip to content

Commit

Permalink
fix: fix url building
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed Jun 19, 2024
1 parent 369a5d7 commit 40e5503
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import open from 'open'


export type UrlOptions = {
staging?: boolean,
staging?: boolean
domain?: string
}



const buildCheckoutUrl = (organization: string, orderId: string, accessToken: string, options: UrlOptions): string => {

const subdomain = options?.staging? 'stg.' : ''
const domain = `${subdomain}${options?.domain || clConfig.api.default_app_domain}`
const subdomain = options.staging? 'stg.' : ''
const domain = `${subdomain}${options.domain || clConfig.api.default_app_domain}`
const baseUrl = clApi.baseURL('core', organization, domain)

const checkoutUrl = `${baseUrl}/checkout/${orderId}?accessToken=${accessToken}`
Expand Down

0 comments on commit 40e5503

Please sign in to comment.