Skip to content

Commit 64c6e95

Browse files
authored
Merge pull request #108 from mahfouzhseineweev/1.0.15
1.0.15
2 parents 7ebbbd5 + b3ea56c commit 64c6e95

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
### [1.0.15] - 2024-12-24
9+
10+
### Fixed
11+
12+
- Fixed refresh section function problem with cname enabled that was not using the website domain
13+
14+
815
### [1.0.14] - 2024-12-16
916

1017
### Fixed

lib/src/components/Sections/index.vue

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,11 +1680,7 @@ export default {
16801680
headers: sectionHeader(((inBrowser) ? {} : {origin: `${scheme}://${websiteDomain}`})),
16811681
};
16821682
1683-
let URL = `${this.$sections.serverUrl}/project/${this.$sections.projectId}/page/${parsePath(encodeURIComponent(this.pageName))}`;
1684-
1685-
if (this.$sections.cname === "active") {
1686-
URL = `${this.$sections.serverUrl}/project/${websiteDomain}/page/${parsePath(encodeURIComponent(this.pageName))}`;
1687-
}
1683+
let URL = `${this.$sections.serverUrl}/project/${this.getSectionProjectIdentity()}/page/${parsePath(encodeURIComponent(this.pageName))}`;
16881684
16891685
let payload = {}
16901686
@@ -2628,6 +2624,20 @@ export default {
26282624
console.warn(this.$t('noFormsFolder'));
26292625
}
26302626
},
2627+
getSectionProjectIdentity() {
2628+
if (this.$sections.cname === "active") {
2629+
const inBrowser = typeof window !== 'undefined';
2630+
let websiteDomain = ""
2631+
if (inBrowser) {
2632+
websiteDomain = window.location.host
2633+
} else {
2634+
websiteDomain = this.$nuxt.context.req.headers.host
2635+
}
2636+
return websiteDomain
2637+
} else {
2638+
return this.$sections.projectId
2639+
}
2640+
},
26312641
async renderConfigurableSection(gt, options) {
26322642
this.$emit("load", true);
26332643
@@ -3238,7 +3248,7 @@ export default {
32383248
}
32393249
}
32403250
3241-
const URL = `${this.$sections.serverUrl}/project/${this.$sections.projectId}/section/render`;
3251+
const URL = `${this.$sections.serverUrl}/project/${this.getSectionProjectIdentity()}/section/render`;
32423252
32433253
for (const sectionData of sectionDatas) {
32443254
const sectionName = sectionData.nameID ? sectionData.nameID : sectionData.name

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@geeks.solutions/nuxt-sections",
3-
"version": "1.0.14",
3+
"version": "1.0.15",
44
"author": "Geeks Solutions info@geeks.solutions (https://www.geeks.solutions)",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)