title: How to delete child object in Strapi
body: <p>I used this topic to delete upload related to articles and it work :
  <a href="https://stackoverflow.com/questions/58551844/how-to-delete-file-from-upload-folder-in-strapi/63605538#63605538">How to delete file from upload folder in strapi?</a></p>
  <p>Now i want a cascade deletion. For when i delete a project, articles and upload will deleted also.
  Somebody know how to delete a project which will delete an article &amp; upload file ?</p>
  <p>This code work to delete a project and children but not the file. And if i try to delete just an article, the controller is called and the file is deleted.</p>
  <p>/api/projects/controllers/projects.js</p>
  <pre><code>module.exports = {
    async delete(ctx) {
      const { id } = ctx.params;
  
      const project = await strapi.services.projects.delete({ id });
  
      if (project){
        for (let article of project.articles) {
          strapi.services.articles.delete({ 'id' : article._id } );
        }
      }
  
      return sanitizeEntity(project, { model: strapi.models.projects });
    }
  </code></pre>
  <p>/api/articles/services/articles.js</p>
  <pre><code>delete(params) {
      return strapi.query('articles').delete(params);
  }
  </code></pre>
  <p>/api/articles/controllers/article.js</p>
  <pre><code>module.exports = {
    async delete(ctx) {
      const { id } = ctx.params;
          
      const entity = await strapi.services.articles.delete({ id });
          
        if (entity) {
            strapi.plugins.upload.services.upload.remove(entity.articleFile);
        }
        
        return sanitizeEntity(entity, { model: strapi.models.articles });
    }
  }
  </code></pre>
  <p>The controller is called when i used the url in API like that :
  DELETE http://localhost:port/banners/&lt;project_ID&gt;</p>
  <p>The strapi.services.xxx.delete is called in the code</p>