Rules become findable: canon catalog, triggers, tiers, edges, retrieval, surfacing (milestone 307, steps 1–5) #131
@@ -35,9 +35,7 @@ export const useRulebooksStore = defineStore("rulebooks", () => {
|
|||||||
async function fetchRules(topicId: number) {
|
async function fetchRules(topicId: number) {
|
||||||
try {
|
try {
|
||||||
const rules = await api.listRules({ topic_id: topicId });
|
const rules = await api.listRules({ topic_id: topicId });
|
||||||
rulesByTopic.value[topicId] = rules.map((r) => ({
|
rulesByTopic.value[topicId] = rules.map(toHeader);
|
||||||
id: r.id, title: r.title, statement: r.statement, topic_id: r.topic_id,
|
|
||||||
}));
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
useToastStore().show("Failed to load rules", "error");
|
useToastStore().show("Failed to load rules", "error");
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
Reference in New Issue
Block a user