Refresh goals and versions on precise goal updates
This commit is contained in:
@@ -5040,7 +5040,7 @@ export async function getPreferredDeviceIdForAccount(
|
||||
}
|
||||
|
||||
export async function toggleGoal(projectId: string, goalId: string) {
|
||||
return mutateState((state) => {
|
||||
const goal = await mutateState((state) => {
|
||||
const project = state.projects.find((item) => item.id === projectId);
|
||||
if (!project) throw new Error("PROJECT_NOT_FOUND");
|
||||
|
||||
@@ -5062,10 +5062,12 @@ export async function toggleGoal(projectId: string, goalId: string) {
|
||||
project.lastMessageAt = nowIso();
|
||||
return goal;
|
||||
});
|
||||
publishBossEvent("conversation.updated", { projectId, note: "project_goals.updated" });
|
||||
return goal;
|
||||
}
|
||||
|
||||
export async function updateGoalText(projectId: string, goalId: string, text: string) {
|
||||
return mutateState((state) => {
|
||||
const goal = await mutateState((state) => {
|
||||
const project = state.projects.find((item) => item.id === projectId);
|
||||
if (!project) throw new Error("PROJECT_NOT_FOUND");
|
||||
|
||||
@@ -5078,10 +5080,12 @@ export async function updateGoalText(projectId: string, goalId: string, text: st
|
||||
project.lastMessageAt = nowIso();
|
||||
return goal;
|
||||
});
|
||||
publishBossEvent("conversation.updated", { projectId, note: "project_goals.updated" });
|
||||
return goal;
|
||||
}
|
||||
|
||||
export async function createGoal(projectId: string, text: string) {
|
||||
return mutateState((state) => {
|
||||
const goal = await mutateState((state) => {
|
||||
const project = state.projects.find((item) => item.id === projectId);
|
||||
if (!project) throw new Error("PROJECT_NOT_FOUND");
|
||||
if (!text.trim()) throw new Error("GOAL_TEXT_REQUIRED");
|
||||
@@ -5097,6 +5101,8 @@ export async function createGoal(projectId: string, text: string) {
|
||||
project.lastMessageAt = nowIso();
|
||||
return goal;
|
||||
});
|
||||
publishBossEvent("conversation.updated", { projectId, note: "project_goals.updated" });
|
||||
return goal;
|
||||
}
|
||||
|
||||
export async function issueVerificationCode(
|
||||
|
||||
Reference in New Issue
Block a user