sugaroverflow / drone-companion-app

collaboration project between Code for Canada + Transport Canada
MIT License
1 stars 3 forks source link

controllers are not filtering by specified ID #194

Closed sugaroverflow closed 5 years ago

sugaroverflow commented 5 years ago

The code inside the controllers:

    if (phaseOId !== null && moduleOId !== null) {
      const filtered = jsonContent.find(item => `${item.orderNum}` === moduleOId).phases
        .find(item => `${item.orderNum}` === phaseOId).tasks;
      return res.json(filtered);
    }

is not actually filtering by phaseOId - it seems to be returning only the correct order of items in the json response. For example, if you add some phase_id= 2 data, you'll see it on the /api/phases/1 response.

Please look into this and confirm that this is happening and fix the filtering issue.

sugaroverflow commented 5 years ago

Not an issue - PEBKAC