rit-sse / node-api

💯 The SSE New and Improved Unified API
https://sse.rit.edu/api/v2
MIT License
8 stars 9 forks source link

Exclude officer field from committee model and requests #103

Closed gavrielrh closed 4 years ago

gavrielrh commented 4 years ago

Since committees do a join with officers when specifying the active field, the officers field is being appended to the committees results.

We only want the commitees' fields, and not those of the officers, so this excludes the officers attributes. Unfortunately, the id attribute of the officer cannot be excluded on the include (because sequelize requires it), so duplicates are still being returned when requesting the active scope when there are multiple officers in one committee.

The changes in routes/commitees.js resolve this, but aren't the prettiest (and ideally we can resolve this in a different way)