@tecof/theme-editor 0.0.31 → 0.0.32
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/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +22 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -247,15 +247,19 @@ var TecofApiClient = class {
|
|
|
247
247
|
*/
|
|
248
248
|
async getCmsCollectionItems(collectionSlug, options) {
|
|
249
249
|
try {
|
|
250
|
+
const body = {
|
|
251
|
+
page: options?.page || 1,
|
|
252
|
+
limit: options?.limit || 50,
|
|
253
|
+
locale: options?.locale
|
|
254
|
+
};
|
|
255
|
+
const sortValue = options?.sort || "custom";
|
|
256
|
+
if (sortValue !== "custom") {
|
|
257
|
+
body.sort = sortValue;
|
|
258
|
+
}
|
|
250
259
|
const res2 = await fetch(`${this.apiUrl}/api/store/cms/collections/${encodeURIComponent(collectionSlug)}/items`, {
|
|
251
260
|
method: "POST",
|
|
252
261
|
headers: this.headers,
|
|
253
|
-
body: JSON.stringify(
|
|
254
|
-
page: options?.page || 1,
|
|
255
|
-
limit: options?.limit || 50,
|
|
256
|
-
sort: options?.sort || "newest",
|
|
257
|
-
locale: options?.locale
|
|
258
|
-
})
|
|
262
|
+
body: JSON.stringify(body)
|
|
259
263
|
});
|
|
260
264
|
return await res2.json();
|
|
261
265
|
} catch (error2) {
|
|
@@ -24810,7 +24814,7 @@ var CmsCollectionField = ({
|
|
|
24810
24814
|
collectionSlug: col.slug,
|
|
24811
24815
|
collectionName: col.name,
|
|
24812
24816
|
limit: value?.limit || defaultLimit,
|
|
24813
|
-
sort: value?.sort || "
|
|
24817
|
+
sort: value?.sort || "custom",
|
|
24814
24818
|
fieldMap: value?.fieldMap || {}
|
|
24815
24819
|
});
|
|
24816
24820
|
setDropdownOpen(false);
|
|
@@ -24959,7 +24963,17 @@ var CmsCollectionField = ({
|
|
|
24959
24963
|
"button",
|
|
24960
24964
|
{
|
|
24961
24965
|
type: "button",
|
|
24962
|
-
className: `tecof-cms-col-sort-btn ${(value.sort || "
|
|
24966
|
+
className: `tecof-cms-col-sort-btn ${(value.sort || "custom") === "custom" ? "active" : ""}`,
|
|
24967
|
+
onClick: () => handleSortChange("custom"),
|
|
24968
|
+
disabled: readOnly,
|
|
24969
|
+
children: "\xD6zel S\u0131ralama"
|
|
24970
|
+
}
|
|
24971
|
+
),
|
|
24972
|
+
/* @__PURE__ */ jsx(
|
|
24973
|
+
"button",
|
|
24974
|
+
{
|
|
24975
|
+
type: "button",
|
|
24976
|
+
className: `tecof-cms-col-sort-btn ${value.sort === "newest" ? "active" : ""}`,
|
|
24963
24977
|
onClick: () => handleSortChange("newest"),
|
|
24964
24978
|
disabled: readOnly,
|
|
24965
24979
|
children: "Yeni\u2192Eski"
|