Open HoekWax opened 1 year ago
Something that can work for you if you have this issue
Convert something like this
export const portalQueryProperties = Type.Pick(portalSchema, [
'id',
'status',
'deletedAt',
'teamId',
'portalUsers'
])
export const portalQuerySchema = Type.Intersect(
[
querySyntax(portalQueryProperties),
// Add additional query properties here
Type.Object({}, { additionalProperties: false })
],
{ additionalProperties: false }
)
export type PortalQuery = Static<typeof portalQuerySchema>
export const portalQueryValidator = getValidator(portalQuerySchema, queryValidator)
export const portalQueryResolver = resolve<PortalQuery, HookContext>({})
to this
export const portalQueryProperties = Type.Pick(portalSchema, [
'id',
'status',
'deletedAt',
'teamId',
'portalUsers'
])
export const portalQuerySchema = Type.Intersect(
[
querySyntax(portalQueryProperties),
// Add additional query properties here
Type.Object({}, { additionalProperties: false })
],
{ additionalProperties: false }
)
export type PortalQuery = Static<typeof portalQuerySchema>
queryValidator,addSchema(portalUserSchema) // 👈
export const portalQueryValidator = getValidator(portalQuerySchema, queryValidator)
export const portalQueryResolver = resolve<PortalQuery, HookContext>({})
You need to user addSchema on the queryValidator
maybe loss that
Hello, I have a table Portal that has multiple PortalUser (basically Ticket and Ticket-user)
in my portalSchema I have an array of PortalUser
portalUsers: Type.Array(Type.Ref(portalUserSchema)),
I can resolve them like so
but if I try to add "portalUsers" to the queryProperties like so
I get this error
event if the id is already set by feathers.