Files
payload/packages/db-postgres/src/transform/write/texts.ts
Gokulsck f43cf185d4 feat: hasMany property for text fields (#4605)
* fix for supporting hasMany property in text field

* Updated docs

* handle text case types for schema and graphql schema

* fix unit test for required failing

* add unit test for has many text field

* add end to end test for has many on text field creation

* support has many feature for text field on postgres

---------

Co-authored-by: Chris Heinz <chrisi.heinz@web.de>
2024-01-04 14:45:00 -05:00

16 lines
288 B
TypeScript

type Args = {
baseRow: Record<string, unknown>
data: unknown[]
texts: Record<string, unknown>[]
}
export const transformTexts = ({ baseRow, data, texts }: Args) => {
data.forEach((val, i) => {
texts.push({
...baseRow,
text: val,
order: i + 1,
})
})
}