homeflowjs 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,12 +129,25 @@ export const setPagination = (payload) => ({
|
|
129
129
|
|
130
130
|
export const postPropertyView = (payload) => () => {
|
131
131
|
const domain = location.hostname;
|
132
|
+
const { sendAsFormData } = Homeflow.get('propertyViewsOptions') ?? {};
|
133
|
+
const data = { property_id: payload, domain };
|
134
|
+
|
135
|
+
let contentType;
|
136
|
+
let body;
|
137
|
+
if (sendAsFormData) {
|
138
|
+
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
|
139
|
+
body = JSON_to_URLEncoded(data);
|
140
|
+
} else {
|
141
|
+
contentType = 'application/json'
|
142
|
+
body = JSON.stringify(data);
|
143
|
+
}
|
144
|
+
|
132
145
|
fetch('/property_views',
|
133
146
|
{
|
134
147
|
method: 'POST',
|
135
148
|
mode: 'no-cors',
|
136
|
-
headers: { 'Content-Type':
|
137
|
-
body
|
149
|
+
headers: { 'Content-Type': contentType },
|
150
|
+
body,
|
138
151
|
});
|
139
152
|
};
|
140
153
|
|