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
Add client and tech data in homeRoute for dashboard and ticket page - RATED 7 #131
Note: This change can occur only after the "as" alias has been added to the relationships in models/index.js
The developer will need to add to the handlebars context object the client user object, and tech user object. This will require undo-ing the current user include statement, and replacing it with two others.
Acceptance criteria:
[x] It is done when the developer modifies both the router.get("/ticket/:id") route and the router.get("/:status?") route
[x] It is done when the Ticket.findAll statement and the Ticket.findByPk includes an "include" array.
[x] It is done when the include array in both methods has two elements included.
The first and second objects both querie to the model: User
The first object has an "as" key set to "client"
The second object has an "as" key set to "tech"
The attributes included for both are only the client/tech's id, first_name, and last_name.
[x] It is done when the currently logged in user's id is passed to the context object as user_id: req.session.user_id
[x] It is done when tickets is logged and it includes an object structured similar to this example:
{
ticket_title,
ticket_text,
status,
urgency,
date_created,
date_updated,
client: {
first_name,
last_name
id
},
tech: {
first_name,
last_name
id
}
}
Please note: the Ticket.findByPk method should still also include the Log model, as it currently does.
Note: This change can occur only after the "as" alias has been added to the relationships in models/index.js
The developer will need to add to the handlebars context object the client user object, and tech user object. This will require undo-ing the current user include statement, and replacing it with two others.
Acceptance criteria:
Please note: the Ticket.findByPk method should still also include the Log model, as it currently does.