update message approval status after processing message

This commit is contained in:
Will Chen
2025-04-18 14:00:05 -07:00
parent a4629e7698
commit e3568f9a97
3 changed files with 33 additions and 16 deletions

View File

@@ -130,7 +130,10 @@ const approveProposalHandler = async (
const processResult = await processFullResponseActions(
messageToApprove.content,
chatId,
{ chatSummary: chatSummary ?? undefined } // Pass summary if found
{
chatSummary: chatSummary ?? undefined,
messageId,
} // Pass summary if found
);
if (processResult.error) {
@@ -146,13 +149,6 @@ const approveProposalHandler = async (
};
}
// 3. Update the message's approval state to 'approved'
await db
.update(messages)
.set({ approvalState: "approved" })
.where(eq(messages.id, messageId));
console.log(`Message ${messageId} marked as approved.`);
return { success: true };
} catch (error) {
console.error(