🐛 (results) Fix export with deleted blocks
Forgot to check for header duplicates
This commit is contained in:
@ -186,17 +186,28 @@ const parseResultsFromPreviousBotVersions = (
|
|||||||
) &&
|
) &&
|
||||||
isNotEmpty(answer.content)
|
isNotEmpty(answer.content)
|
||||||
)
|
)
|
||||||
.map((answer) => ({
|
.reduce<ResultHeaderCell[]>((existingHeaders, answer) => {
|
||||||
id: answer.blockId,
|
if (
|
||||||
label: `Deleted block`,
|
existingHeaders.some(
|
||||||
blocks: [
|
(existingHeader) => existingHeader.id === answer.blockId
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return existingHeaders
|
||||||
|
return [
|
||||||
|
...existingHeaders,
|
||||||
{
|
{
|
||||||
id: answer.blockId,
|
id: answer.blockId,
|
||||||
groupId: answer.groupId,
|
label: `${answer.blockId} (deleted block)`,
|
||||||
|
blocks: [
|
||||||
|
{
|
||||||
|
id: answer.blockId,
|
||||||
|
groupId: answer.groupId,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
blockType: InputBlockType.TEXT,
|
||||||
},
|
},
|
||||||
],
|
]
|
||||||
blockType: InputBlockType.TEXT,
|
}, [])
|
||||||
}))
|
|
||||||
|
|
||||||
export const parseAnswers =
|
export const parseAnswers =
|
||||||
(
|
(
|
||||||
|
Reference in New Issue
Block a user