2
0

🐛 (results) Fix export with deleted blocks

Forgot to check for header duplicates
This commit is contained in:
Baptiste Arnaud
2023-02-14 15:21:29 +01:00
parent eef015e395
commit c35ba58fae

View File

@ -186,9 +186,18 @@ const parseResultsFromPreviousBotVersions = (
) && ) &&
isNotEmpty(answer.content) isNotEmpty(answer.content)
) )
.map((answer) => ({ .reduce<ResultHeaderCell[]>((existingHeaders, answer) => {
if (
existingHeaders.some(
(existingHeader) => existingHeader.id === answer.blockId
)
)
return existingHeaders
return [
...existingHeaders,
{
id: answer.blockId, id: answer.blockId,
label: `Deleted block`, label: `${answer.blockId} (deleted block)`,
blocks: [ blocks: [
{ {
id: answer.blockId, id: answer.blockId,
@ -196,7 +205,9 @@ const parseResultsFromPreviousBotVersions = (
}, },
], ],
blockType: InputBlockType.TEXT, blockType: InputBlockType.TEXT,
})) },
]
}, [])
export const parseAnswers = export const parseAnswers =
( (