Skip to content

Commit 61cdff3

Browse files
committed
Made code more readable.
1 parent 737c0e6 commit 61cdff3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/routes/milestones/update.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,11 @@ module.exports = [
171171
});
172172
})
173173
.then(() => {
174-
// Update dates of the other milestones only if the completionDate nor the duration changed
175-
if (((!original.completionDate && !updated.completionDate) ||
176-
(original.completionDate && updated.completionDate &&
177-
original.completionDate.getTime() === updated.completionDate.getTime())) &&
178-
original.duration === updated.duration) {
179-
return Promise.resolve();
174+
// Update dates of the other milestones only if the completionDate or the duration changed
175+
if (!_.isEqual(original.completionDate, updated.completionDate) || original.duration !== updated.duration) {
176+
return updateComingMilestones(updated);
180177
}
181-
return updateComingMilestones(updated);
178+
return Promise.resolve();
182179
}),
183180
)
184181
.then(() => {

0 commit comments

Comments
 (0)