Open phamquoctuan1 opened 3 years ago
const { Sequelize } = require('sequelize');
require('sequelize-hierarchy')(Sequelize);
const { Sequelize } = require('sequelize'); require('sequelize-hierarchy')(Sequelize);
What does this mean? I import my models in an api.js file with those rows, and I still get this error
I define my model like that but got error
require('sequelize-hierarchy')(); module.exports = (sequelize, DataTypes) => { const Category = sequelize.define('category', { name: { type: DataTypes.STRING, allowNull: false, unique: true, }, slug: { type: DataTypes.STRING, unique: true, }, status: { type: DataTypes.BOOLEAN, }, }); Category.isHierarchy(); SequelizeSlugify.slugifyModel(Category, { source: ['name'] }); return Category; };
Category.isHierarchy is not a function