Second level relations

System Information
  • Strapi Version: 3.4.4:
  • Operating System: Win 10:
  • Database: sql-lite(quick start):
  • Node Version: 14.15.0:
  • NPM Version: 6.14.8:

Hi, I’m first time usung Strapi.
I trying to create org chart. Vue Js + Strapi, and need configurate dependens.

I have position 1 they have his own child position.
At position i see only id of next positio. Can it make array with full information of next position.

Many thanks!

Something like this

I’m tryind to do like this n controllers

Summary

const { sanitizeEntity } = require(‘strapi-utils’);
module.exports = {
/**

  • Retrieve records.
  • @return {Array}
    */

async find(ctx) {
let entities;
if (ctx.query._q) {
entities = await strapi.services.positions.search(ctx.query);
} else {
entities = await strapi.services.positions.find(ctx.query,[‘positions’, ‘positions.child’]);
}

return entities.map(entity => sanitizeEntity(entity, { model: strapi.models.positions }));
},
};

Dut its not working