@ecomcx/ecomweb-theme-sdk 1.34.0 → 1.35.0

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.
Files changed (2) hide show
  1. package/dist/api.js +3 -1
  2. package/package.json +1 -1
package/dist/api.js CHANGED
@@ -186,7 +186,9 @@ async function templateDraft() {
186
186
  /** Template / phần dựng bằng khối của theme đang dùng (bản sửa trong Trình dựng thắng bản của theme; đang xem trước → bản nháp). */
187
187
  export const getTemplates = async () => {
188
188
  const draft = await templateDraft();
189
- return cmsFetch("/templates", draft ? { noStore: true, query: { draft } } : { tags: ["templates"] });
189
+ // Mỗi ngôn ngữ có thể có bản template / phần riêng (chưa có thì API trả bản mặc định)
190
+ const locale = await getRequestLocale();
191
+ return cmsFetch("/templates", draft ? { noStore: true, query: clean({ draft, locale }) } : { tags: ["templates"], query: clean({ locale }) });
190
192
  };
191
193
  /** Nội dung mẫu đồng bộ (khối syncedPattern). null = mẫu đã xoá / chưa xuất bản. */
192
194
  export const getPattern = (id) => cmsFetch(`/patterns/${id}`, { tags: ["patterns", "posts"] }).catch(() => null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecomcx/ecomweb-theme-sdk",
3
- "version": "1.34.0",
3
+ "version": "1.35.0",
4
4
  "description": "SDK để viết theme và phần frontend của plugin cho Ecomweb",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",