Neil-UWA/loopback-remote-routing

Unable to disable nested related models of belongsTo or hasMany or hasOne

ganeshkbhat opened this issue · 1 comments

I am unable to disable the related methods created by models.
I am able to delete top level model methods using @create @find etc. But I am unable to disable nested apis created using relations.

Eg: For the nested api GET /Orgs/{id}/orgDetail/orgs , I have tried:
prototype._get_orgDetail_orgs
prototype.__get__orgDetail_orgs
prototype.__get__orgDetail__get__orgs
prototype.__get__orgDetail_get_orgs
prototype._get_orgDetail_org
prototype.__get__orgDetail_org
prototype.__get__orgDetail__get__org
prototype.__get__orgDetail_get_org
__get__orgDetail_orgs
__get__orgDetail__orgs
__get__orgDetail_get_orgs
__get__orgDetail__get__orgs
__get__orgDetail_org
__get__orgDetail__org
__get__orgDetail_get_org
__get__orgDetail__get__org
__get__orgDetailOrgs
__get__orgDetailOrg

Here are the models

{
  "name": "Org",
  "plural": "Orgs",
  "base": "PersistedModel",
  "properties": {
    "name": {
      "type": "string",
      "required": true
    }
  },
  "validations": [],
  "relations": {
    "orgGroup": {
      "type": "belongsTo",
      "model": "OrgGroup",
      "foreignKey": "groupId",
      "options": {
        "nestRemoting": true
      }
    },
    "orgDetail": {
      "type": "belongsTo",
      "model": "OrgDetail",
      "foreignKey": "detailsId",
      "options": {
        "nestRemoting": true
      }
    }
  }
}
{
  "name": "OrgRegion",
  "plural": "OrgRegions",
  "base": "PersistedModel",
  "properties": {
    "name": {
      "type": "string",
      "required": true
    }
  },
  "relations": {
    "org": {
      "type": "belongsTo",
      "model": "Org",
      "foreignKey": "orgId",
      "options": {
        "nestRemoting": true
      }
    },
    "orgDetail": {
      "type": "belongsTo",
      "model": "OrgDetail",
      "foreignKey": "detailsId",
      "options": {
        "nestRemoting": true
      }
    }
  }
}
{
  "name": "OrgDetail",
  "plural": "OrgDetails",
  "base": "PersistedModel",
  "properties": {
    "owner": {
      "type": "string",
      "required": true
    },
    "email": {
      "type": "string",
      "required": true
    }
  },
  "relations": {
    "orgs": {
      "type": "hasMany",
      "model": "Org",
      "foreignKey": "detailsId",
      "options": {
        "nestRemoting": true
      }
    },
    "orgRegions": {
      "type": "hasMany",
      "model": "OrgRegion",
      "foreignKey": "detailsId",
      "options": {
        "nestRemoting": true
      }
    }
  }
}

currently, this module doesn't support nested relationships. once I have time, I will look into this problem.