diff --git a/packages/typesafe-db/src/customers.ts b/packages/typesafe-db/src/customers.ts index a3b7fd85..fbf47bfa 100644 --- a/packages/typesafe-db/src/customers.ts +++ b/packages/typesafe-db/src/customers.ts @@ -1,7 +1,7 @@ import db from './db.js' import { ExpressionBuilder } from 'kysely' import { Customers, DB, EditedCustomerData } from './types/types.js' -import { jsonObjectFrom } from 'kysely/helpers/postgres' +import { jsonArrayFrom } from 'kysely/helpers/postgres' type CustomerEB = ExpressionBuilder type CustomerWithEditedEB = ExpressionBuilder< @@ -166,7 +166,7 @@ function getCustomerList( ]) .$if(options.withCustomInfoRequest, qb => qb.select(({ eb, ref }) => - jsonObjectFrom( + jsonArrayFrom( eb .selectFrom('customersCustomInfoRequests') .selectAll()