Skip to content

Commit b435574

Browse files
committed
feat: support preview_tenant_id on theme development
1 parent 359e80b commit b435574

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/vite.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ async function request (api, root, url) {
1313
data.override_context = theme.context
1414
}
1515
const body = JSON.stringify(data)
16+
const headers = {
17+
'Content-Type': 'application/json',
18+
}
19+
if (theme.preview_tenant_id) {
20+
headers['X-Tenant-Id'] = theme.preview_tenant_id.toString()
21+
}
1622
const resp = await fetch(api, {
1723
method: 'POST',
18-
headers: {
19-
'Content-Type': 'application/json',
20-
},
24+
headers,
2125
body,
2226
})
2327
return resp.json()

0 commit comments

Comments
 (0)