Skip to content

Commit

Permalink
feat: custom app url can accept ':slug'
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Dec 9, 2024
1 parent fc13399 commit a03fa5a
Show file tree
Hide file tree
Showing 4 changed files with 291 additions and 291 deletions.
36 changes: 18 additions & 18 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@storybook/addon-essentials": "^8.4.6",
"@storybook/addon-interactions": "^8.4.6",
"@storybook/addon-links": "^8.4.6",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/addon-webpack5-compiler-swc": "^1.0.5",
"@storybook/blocks": "^8.4.6",
"@storybook/components": "^8.4.6",
"@storybook/core-common": "^8.4.6",
"@storybook/html": "^8.4.6",
"@storybook/html-webpack5": "^8.4.6",
"@storybook/icons": "^1.2.12",
"@storybook/manager-api": "^8.4.6",
"@storybook/test": "^8.4.6",
"@storybook/theming": "^8.4.6",
"@storybook/types": "^8.4.6",
"@storybook/blocks": "^8.4.7",
"@storybook/components": "^8.4.7",
"@storybook/core-common": "^8.4.7",
"@storybook/html": "^8.4.7",
"@storybook/html-webpack5": "^8.4.7",
"@storybook/icons": "^1.3.0",
"@storybook/manager-api": "^8.4.7",
"@storybook/test": "^8.4.7",
"@storybook/theming": "^8.4.7",
"@storybook/types": "^8.4.7",
"@types/common-tags": "^1.8.4",
"@types/react": "^18",
"babel-loader": "^9.2.1",
"common-tags": "^1.8.2",
"http-server": "^14.1.1",
"nodemon": "^3.1.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^18",
"react-dom": "^18",
"remark-gfm": "^4.0.0",
"sass": "^1.82.0",
"storybook": "^8.4.6",
"storybook": "^8.4.7",
"typescript": "^5.7.2",
"webpack": "^5.97.0"
"webpack": "^5.97.1"
},
"dependencies": {
"@commercelayer/drop-in.js": "workspace:^2.7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/drop-in/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"@commercelayer/js-auth": "^6.7.0",
"@commercelayer/organization-config": "^1.4.11",
"@commercelayer/organization-config": "^1.4.12",
"@commercelayer/sdk": "^6.25.2",
"@types/lodash": "^4.17.13",
"iframe-resizer": "4.4.2",
Expand All @@ -67,7 +67,7 @@
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"nodemon": "^3.1.7",
"puppeteer": "23.10.0",
"puppeteer": "23.10.1",
"sass": "^1.82.0",
"ts-jest": "^29.2.5",
"typescript": "^5.7.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/drop-in/src/apis/commercelayer/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ export async function getOrganizationConfig(

const organization = await getOrganization()

const slug = jwt.payload.organization.slug
const domainPrefix = config.domain === 'commercelayer.co' ? '.stg' : ''
const appEndpoint = `https://${slug}${domainPrefix}.commercelayer.app`
const appEndpoint = `https://:slug${domainPrefix}.commercelayer.app`

const defaultConfig: ConfigJSONWithRequiredLinks = {
mfe: {
Expand Down Expand Up @@ -167,6 +166,7 @@ export async function getOrganizationConfig(
params: {
...params,
accessToken,
slug: jwt.payload.organization.slug,
lang: config.languageCode
}
}
Expand Down
Loading

0 comments on commit a03fa5a

Please sign in to comment.