@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.
- package/dist/api.js +3 -1
- 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
|
-
|
|
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);
|