Skip to content

Commit

Permalink
fix(shop-adapter-oxid): add option to use relative urls without prefi…
Browse files Browse the repository at this point in the history
…x path
  • Loading branch information
Jan committed Jan 25, 2023
1 parent fc5f637 commit bb75600
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/storefront-shop-adapter-oxid/src/providers/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ export class StorefrontShopAdapterOxid<
path,
body = {},
}: FetchParameters): Promise<FetchResponse<Response>> {
let requestUrl = this.additionalOptions.url
let requestUrl = this.additionalOptions.url ?? ''

if (!requestUrl?.endsWith('/') && !path.startsWith('/')) {
if (
!requestUrl?.endsWith('/') &&
!path.startsWith('/') &&
!this.additionalOptions.url
) {
requestUrl += '/'
}

Expand Down
2 changes: 1 addition & 1 deletion packages/storefront-shop-adapter-oxid/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export type AdditionalInputLoginOxid = {
}

export type AdditionalOxidOptions = {
url: string
url?: string
customPaths?: Partial<OxidPaths>
}

Expand Down

0 comments on commit bb75600

Please sign in to comment.