fix: custom info request returns array
This commit is contained in:
parent
b252333702
commit
c7b1ff4c7d
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import db from './db.js'
|
import db from './db.js'
|
||||||
import { ExpressionBuilder } from 'kysely'
|
import { ExpressionBuilder } from 'kysely'
|
||||||
import { Customers, DB, EditedCustomerData } from './types/types.js'
|
import { Customers, DB, EditedCustomerData } from './types/types.js'
|
||||||
import { jsonObjectFrom } from 'kysely/helpers/postgres'
|
import { jsonArrayFrom } from 'kysely/helpers/postgres'
|
||||||
|
|
||||||
type CustomerEB = ExpressionBuilder<DB & { c: Customers }, 'c'>
|
type CustomerEB = ExpressionBuilder<DB & { c: Customers }, 'c'>
|
||||||
type CustomerWithEditedEB = ExpressionBuilder<
|
type CustomerWithEditedEB = ExpressionBuilder<
|
||||||
|
|
@ -166,7 +166,7 @@ function getCustomerList(
|
||||||
])
|
])
|
||||||
.$if(options.withCustomInfoRequest, qb =>
|
.$if(options.withCustomInfoRequest, qb =>
|
||||||
qb.select(({ eb, ref }) =>
|
qb.select(({ eb, ref }) =>
|
||||||
jsonObjectFrom(
|
jsonArrayFrom(
|
||||||
eb
|
eb
|
||||||
.selectFrom('customersCustomInfoRequests')
|
.selectFrom('customersCustomInfoRequests')
|
||||||
.selectAll()
|
.selectAll()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue