MCPcopy Create free account
hub / github.com/Microck/opencode-studio / loadRules

Function loadRules

client-next/src/app/rules/page.tsx:38–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 const [saving, setSaving] = useState(false);
37
38 const loadRules = async () => {
39 try {
40 const data = await getProjectRules();
41 setContent(data.content || "");
42 setSource(data.source || "none");
43 setPath(data.path || null);
44 } catch (err: any) {
45 toast.error(err?.message || "Failed to load rules");
46 }
47 };
48
49 useEffect(() => {
50 loadRules();

Callers 2

RulesPageFunction · 0.85
handleSaveFunction · 0.85

Calls 1

getProjectRulesFunction · 0.90

Tested by

no test coverage detected