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
Have afterCreate logic add a "Created" log to each new ticket - RATED 6 #129
The developer will add a hook which will allow new tickets to automatically log their own creation.
Acceptance criteria:
[x] It's done when the Log model is imported into the Ticket model.
[x] It's done when a hooks object is defined on the ticket model.
[x] It's done when an afterCreate function exists on the hooks object
[x] It's done when the afterCreate function runs asynchronously
[x] It's done when the afterCreate function takes in some data as a parameter
[x] It's done when the afterCreate function tries to create a new Log
The data needed will include the user_id, this user should be the client_id from the data being passed to the afterCreate function
It will include a ticket_id which will come from the id of the passed data
It will need log_text which should simply be "Created"
[x] It's done when if that create behavior fails, the console logs the issue
[x] It's done when the same data parameter is returned from the end of the function
To confirm it's done, the developer should be able to create a new ticket. When the page redirects them, they should see a timeline object on the bottom right of that view; if it didn't work, the bottom right will be empty - check for terminal and console errors.
The developer will add a hook which will allow new tickets to automatically log their own creation.
Acceptance criteria:
To confirm it's done, the developer should be able to create a new ticket. When the page redirects them, they should see a timeline object on the bottom right of that view; if it didn't work, the bottom right will be empty - check for terminal and console errors.