docs: #363 bug fix

This commit is contained in:
Hamid Reza Mohammadi 2023-02-11 21:41:34 +03:30
parent 881127ad00
commit 4b040a7bb3

View File

@ -147,13 +147,6 @@ namespace RMuseum.Services.Implementation
updatePoem = true;
}
if (updatePoem)
{
_context.Update(dbPoem);
_context.Update(dbPage);
}
bool versesDeleted = false;
foreach (var moderatedVerse in moderation.VerseOrderText.Where(v => v.MarkForDelete == true).ToList())
{
@ -174,8 +167,6 @@ namespace RMuseum.Services.Implementation
}
}
bool verseAdded = false;
if(moderation.VerseOrderText.Any(v => v.NewVerse == true))
{
@ -273,9 +264,6 @@ namespace RMuseum.Services.Implementation
poemVerses = undeletedPoemVerss;
}
if (modifiedVerses.Count > 0 || versesDeleted || verseAdded)
{
foreach (var section in sections)
@ -349,8 +337,6 @@ namespace RMuseum.Services.Implementation
}
}
if (dbCorrection.Rhythm != null)
{
if (moderation.RhythmResult == CorrectionReviewResult.NotReviewed)
@ -572,6 +558,7 @@ namespace RMuseum.Services.Implementation
dbCorrection.OriginalLanguage = dbPoem.Language;
dbCorrection.Language = moderation.Language;
dbCorrection.AffectedThePoem = true;
dbPoem.Language = dbCorrection.Language;
updatePoem = true;
foreach (var section in sections)
@ -582,6 +569,12 @@ namespace RMuseum.Services.Implementation
}
}
if (updatePoem)
{
_context.Update(dbPoem);
_context.Update(dbPage);
}
dbCorrection.Reviewed = true;
_context.GanjoorPoemCorrections.Update(dbCorrection);
await _context.SaveChangesAsync();