MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / createRole

Function createRole

deployments/desktop/static/app.js:678–695  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

676}
677
678async function createRole() {
679 const roleName = $("roleName").value.trim();
680 if (!roleName) throw new Error("请输入角色名。");
681 setStatus(`创建角色 ${roleName}`, true);
682 const data = await api("/api/roles", {
683 method: "POST",
684 body: JSON.stringify({
685 action: "create",
686 role_name: roleName,
687 description: $("roleDescription").value.trim(),
688 feishu_chat_id: $("roleChatId").value.trim(),
689 }),
690 });
691 state.roles = data.roles || [];
692 renderRoles(state.roles);
693 await loadUsers(state.userId);
694 setStatus("角色已创建");
695}
696
697function renderProfile(profile) {
698 $("profileSnapshot").textContent = JSON.stringify(profile || {}, null, 2);

Callers

nothing calls this directly

Calls 5

renderRolesFunction · 0.85
$Function · 0.70
setStatusFunction · 0.70
apiFunction · 0.70
loadUsersFunction · 0.70

Tested by

no test coverage detected