@@ -20,13 +20,19 @@ async function StatusTransition(req, res) {
|
||||
res.status(401).send("Unauthorized");
|
||||
return;
|
||||
}
|
||||
res.sendStatus(200);
|
||||
return;
|
||||
|
||||
// return res.sendStatus(200);
|
||||
|
||||
const {
|
||||
id: jobid,
|
||||
status: value,
|
||||
shopid: bodyshopid,
|
||||
} = req.body.event.data.new;
|
||||
|
||||
// Create record OPEN on new item, enter state
|
||||
// If change to SCHEDULE, update the last record and create a new record (update status and end time on old record, create a new record saying we came from previous status going to previous status
|
||||
// (Timeline)
|
||||
// Final status is exported, there is no end date as there is no further transition (has no end date)
|
||||
try {
|
||||
const { update_transitions } = await client.request(
|
||||
queries.UPDATE_OLD_TRANSITION,
|
||||
|
||||
Reference in New Issue
Block a user