rxtATX / OffNOn

In this application, users will be able to submit tickets (requests for help) with their coding work, technical questions, etc. Tickets will be created to be addressed by technicians. This application models the AskBCS and JIRA ticket systems.
2 stars 2 forks source link

Modify relationships to use an alias - RATED 4 #130

Closed rxtATX closed 1 year ago

rxtATX commented 1 year ago

The index.js file in the models folder needs to add an as property to the relationships. This will give us the ability to query all client and all tech data.

Acceptance criteria: In both User.hasMany and both Ticket.belongsTo statements, we need to add an "as" key to the option object. Where the foreign key is "client_id" the "as" property should be set to "client" Where the foreign key is "tech_id" the "as" property should be set to "tech"

Please note: All team members will need to drop the database and re-seed after this change.