Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Made Date Created stay the same, and changed Updated when updated
Browse files Browse the repository at this point in the history
  • Loading branch information
gtaEPIC committed Nov 10, 2023
1 parent f5e6351 commit fdf7bab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/ticketController.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ module.exports.updateTicket = async function (req, res, next) {
let updatedTicket = ticketModel(req.body);
updatedTicket._id = ticket._id;
updatedTicket.record = ticket.record;
updatedTicket.dateCreated = ticket.dateCreated;
updatedTicket.updated = new Date();

let result = await ticketModel.updateOne({ _id: ticket._id }, updatedTicket);
console.log(result);
Expand Down

0 comments on commit fdf7bab

Please sign in to comment.