Skip to content

Commit

Permalink
(fga-eps-mds/2023-1-CAPJu-Doc#68) - Corrige erros de formatação
Browse files Browse the repository at this point in the history
Co-authored-by: Sérgio Cipriano <[email protected]>
Co-authored-by: Vinícius Vieira de Souza <[email protected]>
  • Loading branch information
3 people committed Jul 2, 2023
1 parent 58e3845 commit 74ee636
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/controllers/ProcessController.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ class ProcessController {
const startingProcess =
process.status === "notStarted" && status === "inProgress"
? {
idStage: flowStages[0].idStageA,
effectiveDate: new Date(),
}
idStage: flowStages[0].idStageA,
effectiveDate: new Date(),
}
: {};
let tempProgress = [];
if (process.status === "notStarted" && status === "inProgress") {
Expand All @@ -286,7 +286,7 @@ class ProcessController {
const stageEndDate = new Date(stageStartDate);
stageEndDate.setDate(
stageEndDate.getDate() +
handleVerifyDate(stageStartDate, currentStage.duration)
handleVerifyDate(stageStartDate, currentStage.duration)
);

const progressData = {
Expand Down Expand Up @@ -411,7 +411,7 @@ class ProcessController {
const stageEndDate = new Date(stageStartDate);
stageEndDate.setDate(
stageEndDate.getDate() +
handleVerifyDate(stageStartDate, currentToStage.duration)
handleVerifyDate(stageStartDate, currentToStage.duration)
);

maturityDate = stageEndDate;
Expand All @@ -423,10 +423,12 @@ class ProcessController {
vencimento: maturityDate,
};
tempProgress = currentProcess.progress;
const index = tempProgress.findIndex(x => x.idStage == to);
index === -1 && tempProgress.push(progressData)
const index = tempProgress.findIndex((x) => x.idStage == to);
index === -1 && tempProgress.push(progressData);
} else {
tempProgress = Array.isArray(currentProcess.progress) ? currentProcess.progress : [currentProcess.progres];
tempProgress = Array.isArray(currentProcess.progress)
? currentProcess.progress
: [currentProcess.progres];
tempProgress.pop();
tempProgress[tempProgress.length - 1] = {
idStage: to,
Expand All @@ -435,7 +437,7 @@ class ProcessController {
};
}

console.log("FROM TO", currentProcess.idStage, from, to)
console.log("FROM TO", currentProcess.idStage, from, to);

const process = await Process.update(
{
Expand Down

0 comments on commit 74ee636

Please sign in to comment.