Merge pull request #748 from trheyi/main

chore: Merge user data into payload in SUI libsui index.ts
This commit is contained in:
Max 2024-09-03 19:14:06 +08:00 committed by GitHub
commit 7dc68ef6a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 68 additions and 63 deletions

File diff suppressed because one or more lines are too long

View file

@ -354,10 +354,15 @@ async function __sui_render(
const root = document.body.getAttribute("s:public") || "";
const route = routeAttr ? `${root}${routeAttr}` : window.location.pathname;
console.log("Route", route, elm, root);
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 = {
"Content-Type": "application/json",
Cookie: document.cookie,