Merge pull request #748 from trheyi/main
chore: Merge user data into payload in SUI libsui index.ts
This commit is contained in:
commit
7dc68ef6a4
2 changed files with 68 additions and 63 deletions
120
data/bindata.go
120
data/bindata.go
File diff suppressed because one or more lines are too long
|
|
@ -354,10 +354,15 @@ async function __sui_render(
|
||||||
const root = document.body.getAttribute("s:public") || "";
|
const root = document.body.getAttribute("s:public") || "";
|
||||||
const route = routeAttr ? `${root}${routeAttr}` : window.location.pathname;
|
const route = routeAttr ? `${root}${routeAttr}` : window.location.pathname;
|
||||||
|
|
||||||
console.log("Route", route, elm, root);
|
|
||||||
|
|
||||||
const url = `/api/__yao/sui/v1/render${route}`;
|
const url = `/api/__yao/sui/v1/render${route}`;
|
||||||
const payload = { name, data: { ..._data, ...data }, option };
|
const payload = { name, data: _data, option };
|
||||||
|
|
||||||
|
// merge the user data
|
||||||
|
if (data) {
|
||||||
|
for (const key in data) {
|
||||||
|
payload.data[key] = data[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
const headers = {
|
const headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Cookie: document.cookie,
|
Cookie: document.cookie,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue