Closed
Description
Versions
sequelize: ^6.1.1
sequelize-typescript: 2.0.0-beta.0
typescript: ^3.9.3
I'm submitting a ...
[x] bug report
[ ] feature request
Actual behavior:
Type 'typeof ProductsProperties' is not assignable to type 'typeof Model'.
Construct signature return types 'ProductsProperties' and 'Model<TModelAttributes, TCreationAttributes>' are incompatible.
The types of '_attributes' are incompatible between these types.
Type 'ProductsProperties' is not assignable to type 'TModelAttributes'.
Model class:
import { Model } from 'sequelize-typescript'
export interface ProductsPropertiesAttributes {
id?: number
value: string
createdAt: Date
}
export class ProductsProperties extends Model<ProductsProperties, ProductsPropertiesAttributes> {
...
}
Error getting in below code where the model is having red line:
this.productsModel.findByPk(keycode, {
attributes: ['keycode', 'name'],
include: [{
model: ProductsProperties
}]
})
Metadata
Metadata
Assignees
Labels
No labels