♻️ Remove @typebot.io/schemas from @typebot.io/lib
This commit is contained in:
15
packages/results/parseColumnsOrder.ts
Normal file
15
packages/results/parseColumnsOrder.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { ResultHeaderCell } from '@typebot.io/schemas'
|
||||
|
||||
export const parseColumnsOrder = (
|
||||
existingOrder: string[] | undefined,
|
||||
resultHeader: ResultHeaderCell[]
|
||||
) =>
|
||||
existingOrder
|
||||
? [
|
||||
...existingOrder.slice(0, -1),
|
||||
...resultHeader
|
||||
.filter((header) => !existingOrder.includes(header.id))
|
||||
.map((h) => h.id),
|
||||
'logs',
|
||||
]
|
||||
: ['select', ...resultHeader.map((h) => h.id), 'logs']
|
Reference in New Issue
Block a user