Olá, estou com o seguinte erro no meu código :
throw new sequelizeError.ValidationError(null, this.errors);
^
ValidationError [SequelizeValidationError]: notNull Violation: fornecedor.empresa cannot be null,
notNull Violation: fornecedor.email cannot be null,
notNull Violation: fornecedor.categoria cannot be null
at InstanceValidator._validate (C:\Users\JULIO\Desktop\apicruso\api\node_modules\sequelize\lib\instance-validator.js:50:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async InstanceValidator._validateAndRunHooks (C:\Users\JULIO\Desktop\apicruso\api\node_modules\sequelize\lib\instance-validator.js:60:7)
at async InstanceValidator.validate (C:\Users\JULIO\Desktop\apicruso\api\node_modules\sequelize\lib\instance-validator.js:54:12)
at async model.save (C:\Users\JULIO\Desktop\apicruso\api\node_modules\sequelize\lib\model.js:2353:7)
at async Function.create (C:\Users\JULIO\Desktop\apicruso\api\node_modules\sequelize\lib\model.js:1329:12)
at async Fornecedor.criar (C:\Users\JULIO\Desktop\apicruso\api\rotas\fornecedors\Fornecedor.js:16:31)
at async C:\Users\JULIO\Desktop\apicruso\api\rotas\fornecedors\index.js:16:9 {
errors: [
ValidationErrorItem {
message: 'fornecedor.empresa cannot be null',
type: 'notNull Violation',
path: 'empresa',
value: null,
origin: 'CORE',
instance: fornecedor {
dataValues: {
versao: 0,
id: null,
empresa: undefined,
email: undefined,
categoria: undefined,
dataAtualizacao: 2022-02-24T01:13:37.948Z,
datacriacao: 2022-02-24T01:13:37.948Z
},
_previousDataValues: {},
uniqno: 1,
_changed: Set(0) {},
_options: {
isNewRecord: true,
_schema: null,
_schemaDelimiter: '',
attributes: undefined,
include: undefined,
raw: undefined,
silent: undefined
},
isNewRecord: true
},
validatorKey: 'is_null',
validatorName: null,
validatorArgs: []
},
ValidationErrorItem {
message: 'fornecedor.email cannot be null',
type: 'notNull Violation',
path: 'email',
value: null,
origin: 'CORE',
instance: fornecedor {
dataValues: {
versao: 0,
id: null,
empresa: undefined,
email: undefined,
categoria: undefined,
dataAtualizacao: 2022-02-24T01:13:37.948Z,
datacriacao: 2022-02-24T01:13:37.948Z
},
_previousDataValues: {},
uniqno: 1,
_changed: Set(0) {},
_options: {
isNewRecord: true,
_schema: null,
_schemaDelimiter: '',
attributes: undefined,
include: undefined,
raw: undefined,
silent: undefined
},
isNewRecord: true
},
validatorKey: 'is_null',
validatorName: null,
validatorArgs: []
},
ValidationErrorItem {
message: 'fornecedor.categoria cannot be null',
type: 'notNull Violation',
path: 'categoria',
value: null,
origin: 'CORE',
instance: fornecedor {
dataValues: {
versao: 0,
id: null,
empresa: undefined,
email: undefined,
categoria: undefined,
dataAtualizacao: 2022-02-24T01:13:37.948Z,
datacriacao: 2022-02-24T01:13:37.948Z
},
_previousDataValues: {},
uniqno: 1,
_changed: Set(0) {},
_options: {
isNewRecord: true,
_schema: null,
_schemaDelimiter: '',
attributes: undefined,
include: undefined,
raw: undefined,
silent: undefined
},
isNewRecord: true
},
validatorKey: 'is_null',
validatorName: null,
validatorArgs: []
}
]
}
Alguém poderia me dizer o que poderia estar causando este problema?