У меня есть одна связь между двумя моделями продукта и ценами продукта. Продукт имеет одну цену продукта, а цена продукта принадлежит продукту. Но я не могу использовать метод get, который был добавлен в репозиторий продуктов после успешного внедрения одного отношения.
Вот код
@get('/products/{id}/product-price', {
responses: {
'200': {
description: 'Array of productPrice\'s belonging to Product',
content: {
'application/json': {
schema: { type: 'array', items: getModelSchemaRef(ProductPrice) },
},
},
},
},
})
async find(
@param.path.number('id') id: number,
@param.query.object('filter') filter?: Filter<ProductPrice>,
@param.query.object('where', getWhereSchemaFor(ProductPrice)) where?: Where<ProductPrice>,
): Promise<ProductPrice[]> {
return this.productRepository.productPrices(id).get(filter) // error
}
Здесь есть ошибка
Type 'ProductPrice' is missing the following properties from type 'ProductPrice[]': length, pop, push, concat, and 26 more