File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
packages/pwa-kit-create-app/assets
bootstrap/js/overrides/app
templates/@salesforce/retail-react-app/app Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const Home = () => {
5454 if (res) {
5555 res.set(
5656 'Cache-Control',
57- `s-maxage=${MAX_CACHE_AGE}, stale-while-revalidate={STALE_WHILE_REVALIDATE}`
57+ `s-maxage=${MAX_CACHE_AGE}, stale-while-revalidate=$ {STALE_WHILE_REVALIDATE}`
5858 )
5959 }
6060
Original file line number Diff line number Diff line change @@ -467,19 +467,21 @@ const {handler} = runtime.createHandler(options, (app) => {
467467 }
468468 return data
469469 }
470-
470+
471471 // Helper function to fetch payment metadata from the Commerce Cloud instance
472472 app.get('/api/payment-metadata', async (req, res) => {
473473 try {
474474 const response = await fetch(config.app.sfPayments.metadataUrl, {
475- headers: { Accept: 'application/json' }
475+ headers: {Accept: 'application/json'}
476476 })
477477 if (!response.ok) {
478478 throw new Error(`Metadata request failed with status: ${response.status}`)
479479 }
480480 const data = await response.json()
481- const transformedData = transformIconPaths(data, new URL(config.app.sfPayments.metadataUrl).hostname)
482- res.setHeader('Access-Control-Allow-Origin', '*')
481+ const transformedData = transformIconPaths(
482+ data,
483+ new URL(config.app.sfPayments.metadataUrl).hostname
484+ )
483485 res.setHeader('Content-Type', 'application/json')
484486 res.json(transformedData)
485487 } catch (error) {
Original file line number Diff line number Diff line change @@ -467,19 +467,21 @@ const {handler} = runtime.createHandler(options, (app) => {
467467 }
468468 return data
469469 }
470-
470+
471471 // Helper function to fetch payment metadata from the Commerce Cloud instance
472472 app.get('/api/payment-metadata', async (req, res) => {
473473 try {
474474 const response = await fetch(config.app.sfPayments.metadataUrl, {
475- headers: { Accept: 'application/json' }
475+ headers: {Accept: 'application/json'}
476476 })
477477 if (!response.ok) {
478478 throw new Error(`Metadata request failed with status: ${response.status}`)
479479 }
480480 const data = await response.json()
481- const transformedData = transformIconPaths(data, new URL(config.app.sfPayments.metadataUrl).hostname)
482- res.setHeader('Access-Control-Allow-Origin', '*')
481+ const transformedData = transformIconPaths(
482+ data,
483+ new URL(config.app.sfPayments.metadataUrl).hostname
484+ )
483485 res.setHeader('Content-Type', 'application/json')
484486 res.json(transformedData)
485487 } catch (error) {
You can’t perform that action at this time.
0 commit comments