0

I have: - the framework Feathers ^2.2.3 - ORM sequelize (feathers-sequelize ^2.3.2) - MySQL database - 2 tables (between them should work communication)

in file category.model.js describe the relationship:

category.associate = function (models) {
    models.category.belongsTo(models.category_translate, {
      foreignKey: 'id',
      targetKey: 'category_id',
      as: 'translate'
    });
  };

Now if you open localhost:3030/category then the result of this query is showed:

SELECT `id`, `icon`, `parent` FROM `category` AS `category` LIMIT 10;

Tried so localhost:3030/category?$select[]=translate, to access the fields from a linked table, but there was an error.

What I'm doing wrong? How can I access data from another link table from the current model?

Thank You in advance for the answers!

Glorfindel
  • 21,988
  • 13
  • 81
  • 109

0 Answers0