2
0

🚸 (results) Improve results action buttons

Now have an export all modal with settings and a better column order form
This commit is contained in:
Baptiste Arnaud
2023-02-14 14:33:26 +01:00
parent 1a3596b15c
commit 08e33fbe70
16 changed files with 645 additions and 373 deletions

View File

@@ -99,9 +99,10 @@ const processAndSaveAnswer =
block: InputBlock
) =>
async (reply: string): Promise<Variable[]> => {
state.result &&
!state.isPreview &&
(await saveAnswer(state.result.id, block)(reply))
if (!state.isPreview && state.result) {
await saveAnswer(state.result.id, block)(reply)
if (!state.result.hasStarted) await setResultAsStarted(state.result.id)
}
const newVariables = saveVariableValueIfAny(state, block)(reply)
return newVariables
}
@@ -126,6 +127,13 @@ const saveVariableValueIfAny =
]
}
const setResultAsStarted = async (resultId: string) => {
await prisma.result.update({
where: { id: resultId },
data: { hasStarted: true },
})
}
const parseRetryMessage = (
block: InputBlock
): Pick<ChatReply, 'messages' | 'input'> => {