@websline/cms-view-utils 1.2.3 → 1.2.4
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.
- package/package.json +1 -1
- package/src/client/fetchFaqs.js +28 -0
- package/src/index.js +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const fetchFaqs = async ({ excludeId, limit, locale, tags }) => {
|
|
2
|
+
const params = new URLSearchParams();
|
|
3
|
+
|
|
4
|
+
if (excludeId != null && excludeId !== "") {
|
|
5
|
+
params.set("excludeId", excludeId);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (limit != null) {
|
|
9
|
+
params.set("limit", limit);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (Array.isArray(tags)) {
|
|
13
|
+
for (const tag of tags) {
|
|
14
|
+
if (tag != null && tag !== "") {
|
|
15
|
+
params.append("tags", tag);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const query = params.toString();
|
|
21
|
+
const url = `/api/cms/api/public/abm-faqs/${locale}${query ? `?${query}` : ""}`;
|
|
22
|
+
|
|
23
|
+
const response = await fetch(url, { method: "GET" });
|
|
24
|
+
|
|
25
|
+
return response.json();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { fetchFaqs };
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { isValid } from "./editor/blockValidation.js";
|
|
2
2
|
export { fetchSimilarRooms } from "./client/fetchSimilarRooms.js";
|
|
3
3
|
export { fetchSimilarPackages } from "./client/fetchSimilarPackages.js";
|
|
4
|
+
export { fetchFaqs } from "./client/fetchFaqs.js";
|
|
4
5
|
|
|
5
6
|
export { default as AddBlockPlaceholder } from "./components/AddBlockPlaceholder.svelte";
|
|
6
7
|
export { default as BlockWrapper } from "./components/BlockWrapper.svelte";
|